Tkinter idioms (was: Some basic questions about Tkinter (probably v easy for experts!))

Cameron Laird claird at starbase.neosoft.com
Fri Feb 9 12:25:22 EST 2001


In article <ADBg6.13592$AH6.2042423 at newsc.telia.net>,
Fredrik Lundh <fredrik at effbot.org> wrote:
			.
			.
			.
>not directly -- there's something called lambdas (in Python, not
>in Tkinter), but it's usually better to use a plain function:
>
>    def myfunc():
>        otherfunc(1, 2, 3)
>
>    b = Button(master, command=myfunc)
>
>Cheers /F
>
>

Tell me if this is pertinent--I find myself writing a
lot of formulaic lambdas in my Tkinter compositions.
Example:  a Button command has a no-arg signature, but
when I want to gang some other binding to the same com-
mand, I have to write a trivial lambda to ignore the
supplied event.  Is there something I'm missing?
-- 

Cameron Laird <claird at NeoSoft.com>
Business:  http://www.Phaseit.net
Personal:  http://starbase.neosoft.com/~claird/home.html



More information about the Python-list mailing list