Original Post
Designing a GUI library of my own, I'm wondering about how best to arrange the widget components for reuse. How do you use your GUIs? I've been considering several designs really: Standard inheritance: Functor based: Callback based: Thoughts? Comments? Suggestions?
class my_button : public button
{
public:
void on_click( void )
{
// do stuff
}
};
void on_click( void )
{
// do stuff
}
button b;
b.set_click( on_click );
void event_callback( std::string control, std::string message )
{
if ( control == "button" && message == "on_click" )
{
// do stuff
}
}