Hello,
is it possible to get a common event handling function working?
One function that is used to handle different kind of Events (just like one function for every ButtonClicked Message in a window).
Of course I can assign the same function to different Buttons, but i cant get the name of the button pressed, to decide what to do.
in a few words: i want to have a win32 like MessageProc function for cegui windows.
thanks
xardias
Common Event handling Function
Moderators: CEGUI MVP, CEGUI Team
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
Re: Common Event handling Function
There is no way to determine the name of the event that occured.
But for a PushButton Clicked event you can easily get the window in question.
Consider this event handler:
But for a PushButton Clicked event you can easily get the window in question.
Consider this event handler:
Code: Select all
bool handler(const EventArgs& e)
{
Window* w = static_cast<const WindowEventArgs&>(e).window;
if (w->getName() == "Hello")
{
w->setText("Hello world");
}
else
{
w->setText("Bye world!");
}
return true;
}Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 9 guests
