[wxpython-users] dynamic vs. static event binding in a custom popup menu class

Olga Marchevska olga.marchevska at gmail.com
Tue Apr 8 01:07:57 PDT 2008


Robin,

Thanks for explanation.

It seems, that explicit Unbind() for temporarily created controls is 
more safe (to avoid events from already dead windows).

--
Olga Marchevska

-------- Original Message  --------
Subject: Re:[wxpython-users] dynamic vs. static event binding in a 
custom	popup	menu class
From: Robin Dunn <robin at alldunn.com>
To: wxpython-users at lists.wxwidgets.org
Date: Mon Apr 07 2008 21:14:21 GMT+0400

> Olga Marchevska wrote:
>> Hello,
>>
>> Please help me with a couple of related questions:
>>
>> - Aren't event handlers unbound automatically when a window is destroyed?
> 
> Yes.
> 
>>
>> - If yes, is there a difference for handlers bound to the event source 
>> window:            window.Bind(event, func)
>> and handlers bound to some parent window or frame:
>>     ParentWindow.Bind(event, func, window)?
> 
> 
> Yes.  If window is destroyed before ParentWindow is destroyed, then in 
> the later case ParentWindow will still have event bindings for events 
> coming from window.  (Which won't ever happen unless some other child 
> window is created with the same ID.)
> 
> 


More information about the wxpython-users mailing list