I am using a common event handler for a set of listboxes for onselectionchanged event. If I need to identify the listbox for which this event got fired from the eventhandler funtion using EventArgs, how do I do it.
Pl let me know with a code snippet.
Your help will be appreciated.
thanks in advance
krithiga
Trap window on which the event got fired -in case of common
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Trap window on which the event got fired -in case of co
cast the args to a WindowEventArgs and look at the window field (casting to Listbox if required).
There was a post a few days ago about casting the args object passed to event handlers.
CE.
Code: Select all
bool myHandler(const EventArgs& args)
{
Window* wnd = static_cast<const WindowEventArgs&>(args).window;
Listbox* listbox = static_cast<Listbox*>(wnd);
// Do something useful...
}
There was a post a few days ago about casting the args object passed to event handlers.
CE.
Return to “Offtopic Discussion”
Who is online
Users browsing this forum: No registered users and 2 guests