Re: wxEuphoria - get_facenames() issue
- Posted by Matt Lewis <matthewwalkerlewis at gm?i?.com> Feb 05, 2008
- 820 views
Greg Haberek wrote: > > Everything seemed to launch correctly, but my menus don't work! > > I give my corresponding menu items and toolbar buttons the same wxID_---- > values, > so they trigger the same events. To catch all these events in a single > handler, > I pass -1 as the id to set_event_handler(): >
set_event_handler( frmMain, -1, wxEVT_COMMAND_MENU_SELECTED, routine_id("menus_onClick") ) set_event_handler( tbrMain, -1, wxEVT_COMMAND_MENU_SELECTED, routine_id("menus_onClick") )
> > On Windows, this worked great. But on Linux (Ubuntu 7.10), only the toolbar > events get passed, and the menus do nothing. Menu events have been a thorn in my side for quite some time. I believe that the problem arises from the differences in the GTK and Windows event systems. From the Menus topic in the wxeu docs: When setting a wxEVT_COMMAND_MENU_SELECTED event, you should pass the pointer to the wxMenu parent of the wxMenuItem. Use of the {wxFrame, wxMenu} parameter is deprecated, and should not be used on any platform. I've fought this issue many times, and I think now I have the best solution. Part of the problem is that I have to take whatever I'm handed by wxWidgets, and link it to a euphoria routine_id. There are quirks on both systems, and so I have to code around them. Timers are another problem. If you're interested in joining the fight, the relevant stuff is in wxEuphoria.cpp. Look for wxEuClientData, EuEvent and set_event_handler. Matt