newbie: binding args in callbacks

Edward K. Ream edream at tds.net
Wed Jul 10 10:49:33 EDT 2002


> > I've no idea about Tkinter at all, but this should accomplish what you
> > need:
> >
> >     command=lambda: self.myCallback(val)
> 
> Thanks very much.  That did the trick.  I've been wondering how to
> define lambda expressions with no args ;-)

I spoke too soon.  This does _not_ work.  All the callbacks get bound to
a callback that uses the last val in the list.  Alex's way _does_ work.

Edward
--------------------------------------------------------------------
Edward K. Ream   email:  edream at tds.net
Leo: Literate Editor with Outlines
Leo: http://personalpages.tds.net/~edream/front.html
--------------------------------------------------------------------



More information about the Python-list mailing list