One more Event Question
Mark Erbaugh
mark at microenh.com
Sun Dec 2 15:43:13 PST 2007
I'm working through "wxPython in Action" and trying to understand event
processing.
When a handler is bound to an event,
i.e. self.Bind(wx.EVT_BUTTON, self.OnClick, aButton)
what objects are created? I tried tracing the code, but it went to the
C code with a call to _core_.EvtHandler_Connect(*args, **kwargs) in
EvtHandler.Connect.
Do This objects need to be destroyed, presumbly with a call to UnBind?
The Bind mechanism appears to allow binding of an event from one object
to a handler in another object. I understand that this is needed to
bind an event handler for a button click to the associated frame. Would
it also be possible to bind an event handler from a totally separate
object? When the button and the event handler are both in the same
frame object, destroying the frame destroys the button as well. What
would happen if the event handler was in a separate object and that
object were destroyed, but the button wasn't?
Mark
More information about the wxpython-users
mailing list