My interim solution is to bind the event to a general purpose handler object, like so:
Code: Select all
class evtHandler {
public:
explicit evtHandler(Window * wnd, const CEGUI::String & evt) : m_evt(evt) {
wnd->subscribeEvent(evt, Event::Subscriber(&evtHandler::handler, this));
}
protected:
bool handler(const EventArgs & args) {
// do something useful based on args->window and m_evt
return true;
}
private:
const CEGUI::String & m_evt;
};
Does anybody know of a better way to accomplish this?