Anyway, normally I use a signal class and each widget defines a signal handler per event.
So you end up something like this.
class Button : public Widget
{
private:
signal1<Button*> OnClicked;
public:
signal1<Button*> *get_clicked_signal();
}
The trouble with this approach is you end up creating a lot of signals on some widgets, and creating a widget is a bit messy.
By the time you have called the gets on the each event you may have a dozen lines of code.
So I'm thinking of other approaches. I don't like the old win32 idea of having a single message pump, you end up with a huge switch statement with rubbish like this
switch (message)
{
case BACKBUTTON_PRESSED:
break;
case FORWARDBUTTON_PRESSED:
break;
........................................................
case LITTLE_WIDGET_IN_THE_TOP_LEFT_CORNER_MOUSE_OVER:
break;
case OH_MY_GOD_IF_I_ADD_ONE_MORE_CASE_TO_THIS_SWITCH_I_WILL_KILL_MYSELF:
break;
}
So I'm wondering if anyone has come up with a different approach.
It's more from boredom of having to create yet another gui than anything else












