
Event Binding and Variable Passing
Quote:
>You need to use a lamda expression.
>def fun(x):
> print x
>b.bind('<Button-1>', lambda event, b=x: fun(b))
.
.
.
Can one of the old(er?)-timers help me with this?
There's a sect (claiming the Guido among its sym-
pathizers) that deprecates lambdas for Python, no?
But their reasons (very abstractly, that object-
oriented metaprogramming gives more than enough
goodies, making lambdas essentially redundant) do
*not* apply for communication with the event- and
binding-mechanisms adapted from Tcl, true? The
conclusion would be, then, that Tkinter forces a
fundamental need for lambdas.
--
Business: http://www.Phaseit.net
Personal: http://starbase.neosoft.com/~claird/home.html