I'm not finding any specific examples of what I'm wanting to do. Can anyone confirm this for me?
I've set up a menu on my wxFrame, like so:
EVT_MENU(self, ID_SPAM, self.panel.OnSpam)
EVT_MENU(self, ID_EGGS, self.panel.OnEggs)
Now, I need to change this panel for a new one, and changing the menu to match the new panel. I'm presuming that I should disconnect the events when I do this. (Or is it safe to leave them, and presume that a new menu won't send a command with that ID? What if I'm re-using the ID in the new menu -- will the new event binding replace the old one, or will it be appended to a list?)
To disconnect the above events, I believe that I'd need to specify the command IDs and the event type, like so:
self.Disconnect(ID_SPAM, -1, wxEVT_COMMAND_MENU_SELECTED)
self.Disconnect(ID_EGGS, -1, wxEVT_COMMAND_MENU_SELECTED)
Is that the right syntax? The examples I've seen haven't needed to specify an ID, so I'm not sure I'm getting it in the right position. Alternatively, if I don't specify an ID at all, like this
self.Disconnect(-1, -1, wxEVT_COMMAND_MENU_SELECTED)
will that disconnect *all* menu events for the frame? That could be handy, as it's probably easier for me to just wipe the slate clean and rebuild the menu and event table from scratch, rather than trying to keep track of which menu items stay the same and which need to go...
Jeff Shannon
Technician/Programmer
Credit International