The current idea is to implement it like this: (might still be changed though)
button->callbacks = tgui::Button::LeftMouseClick; // This can be set to multiple callbacks by using '|'
button->callbackFunction = myCallbackFunc;
You will even be able put the callback function in a class.
class myClass: public tgui::CallbackManager
{
bool callbackFunction(const tgui::Callback& callback);
}
button->callbackClass = myClass;
Of course in the above way, it isn't possible to have a callback function for every event (e.g. send unfocus and focus events to different functions). You can only have one callback function per object.
Also every class can only hold one callback function, as it has to be named 'callbackFunction'.
The last disadvantage is that the function has to be very strict: bool as return type and tgui::Callback as parameter.
However, the above code has been tested and I am thus sure that I could implement this.
I will of course see if it is possible to do something like you suggested, but I fear that I won't get very far.
In bigger projects you will probably use classes and the above implementation is the only one that I found so far that can send callbacks to a non-static member function.
But as your suggestion with the addCallback method seems easier to use than what I have implemented so far, I will definately keep looking to get something like that to work (whenever I find the time for it).