[wxPython-users] Bind arguments

Cody Precord codyprecord at gmail.com
Sun Mar 16 14:44:29 PDT 2008


Hello,

On Mar 16, 2008, at 12:53 PM, Matt Webster wrote:

>
> After fooling around for a few hours with this, I'm getting to the  
> point where I believe the Bind() doesn't allow functions with  
> arguments. Every example I've pulled on the web supports this but  
> so far I haven't found any docs that say this too.
>
Using lambda functions should do what you want.

self.Bind(wx.EVT_BUTTON, lambda evt: self.OnShow(evt, '7'), id=1)

> Ideas?
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users- 
> help at lists.wxwidgets.org
>

Regards,

Cody Precord




More information about the wxpython-users mailing list