Thanks for the quick tutorial. If I hadn't rated you up all the way already I'd do so now.
Unfortunately for me, the design of how to take action just doesn't appeal to me. I guess I'll just have to finish work on DaedalusGUI :D
Since you asked for other options, here's how I do it. The root widget is actually a kind of manager for the entire GUI (since I can have multiple OS windows, each window has it's own manager/root widget. You can register callbacks with the root like so:
guiRootNew.AddCommand(widgetPointer, GUI::MOUSE1_UP, boost::bind(&GUI::IBase::ProcessMessage, base, GUI::HIDE, mMouse) );guiRootNew.AddCommand("testbutton2", GUI::MOUSE1_UP, boost::bind(&GUI::IBase::ProcessMessage, base, GUI::SHOW, mMouse) );guiRootNew.AddCommand("quitbutton", GUI::MOUSE1_UP, boost::bind(&Daedalus::Quit) );
So a combination of the widget you want to attach the callback to (although under the hood, it's stored with the root instead), the message that you want to react to, and a function object that will be called.
At the moment all widgets react to all messages, but I'm going to change that so images for instance don't react to button presses.
To me this design seems cleaner to use than the if/else statements you have. My design is comparable to a kind of signal/slot system as is also available in boost.