Question on code in Chapter 8 of "wxPython In Action"
John Clark
john.clark at cabbage-rose.com
Wed May 2 11:14:37 PDT 2007
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/20070502/269d3bea/attachment.htm
More information about the wxpython-users
mailing list