Nothing to add
views:
97answers:
1Do you want an event when your menu is opened? Use EVT_MENU_OPEN(func)
(wxMenuEvent
). But it's not in particular precise. As the documentation says, it is only sent once if you open a menu. For another event you have to close it and open another menu again. I.e in between, you can open other menus (by hovering other items in the menubar), and the event won't be sent again.
What do you need this for? Probably there is another way to do it, instead of listening for this kind of event.
If you want an event for all items of a menu, use EVT_MENU_RANGE(id1, id2, func)
(it's using wxCommandEvent
). All IDs starting from id1
up to and including id2
will be connected to the given event handler. Using a range instead of connecting each item separate will provide for better performance, as there are fewer items in the event-handler list.