Okay, I’m still going through the wxPython In Action book and have questions now on the code in Chapter 8. In Listing 8.12 the code reads something like:
def OnCheckCanSplit(self, evt):
evt.Enable(not self.sp.IsSplit())
What I don’t understand here is calling Enable on an event - it would seem to me that the code should use the ID that is provided by the event to track down the menu item that is raising the event and then call Enable on that menu item. Instead, it seems that calling Enable on the event is actually causing the menu item that raised the event to be enabled or disabled. I tracked this down to a call to
_core_.UpdateUIEvent_Enable
So it seems that there UpdateUIEvents can pass messages (such as “enable”) back to the controls that raised the event. My questions are: are UpdateUIEvents the only type of event that can do this? And what types of widgets will actually generate this type of event? Is it only menu item widgets that will do this?
Thanks,
-jdc