What do you want to improve? I think the only thing thats missing is a option to connect functions directly to gui events like in any other gui sdk.3DModelerMan wrote:I've been fascinated with event systems lately. Would anyone like it if I improved the event receiver?
lets say you create a button
IGUIButton* button = gui->addButton(...);
now have either
button->addListener(EGET_BUTTON_CLICKED, functionpointer);
or
button->addListener(EGET_BUTTON_CLICKED, someClassPointer, &someClass::methodpointer);
this doesn't have to be implemented in the IGUIElement. This was just an idea. maybe instead.
gui->connect(EGET_BUTTON_CLICKED, button, funcPointer);
or
gui->connect(EGET_BUTTON_CLICKED, button, someClassPointer, &someClass::methodpointer);
and then ofcourse the corresponding disconnects incase the the IGUIElement or the connected class runs out of scope/is deleted