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

Robin Dunn robin at alldunn.com
Thu Apr 3 15:40:20 PDT 2008


Tim Black wrote:

> It seems to me that the negative performance impact of binding each time the
> popup is created would be minimal, and that the benefit gained from
> encapsulating all menu-related stuff in the PopupMenu class outweighs this. The
> possible downside to 0. is that I don't know how to unbind events each time the
> popup menu is destroyed so that I don't get a leak in the window's event handler
> table. 


There is an Unbind method that takes the same parameters as the Bind 
method except you don't pass the handler function.  Or you can just use 
Bind and pass None for the handler function.


-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!



More information about the wxpython-users mailing list