Hi,
Thus spoketh "Michael O'Donnell" <[email protected]>
unto us on Sat, 18 Dec 2010 18:53:01 +0100:
> Hi Michael,
>
> > self.root.protocol('WM_DELETE_WINDOW', lambda : greeting(self))
>
> I've had trouble with lambdas, because variables are not resolved
> at declaration time, but at execution time. WOuld not the following be
> better:
>
> self.root.protocol('WM_DELETE_WINDOW', lambda w=self : greeting(w))
>
> ....too tired to actually test your code.
I don't like lambdas too much either :)
In this case both variants will work, still I'd prefer to wrap the
lambbda into a class method, but that's just a matter of taste.
Regards
Michael
.-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-.
The heart is not a logical organ.
-- Dr. Janet Wallace, "The Deadly Years", stardate 3479.4
_______________________________________________
Tkinter-discuss mailing list
[email protected]
http://mail.python.org/mailman/listinfo/tkinter-discuss