On Thu, Jan 29, 2009 at 2:15 PM, <david.gie...@kodak.com> wrote: > With lambda, you need to set the value of the variable at the time the > lambda is created, or else the variable is grabbed from the environment at > the time the lambda runs. You can do this by using the variable as a > default argument. In your case, change: > > XT.append(Button(T,text="Viola:New > Tab",command=lambda:switch_tabs(whoopsie)) > > to > > XT.append(Button(T,text="Viola:New Tab",command=lambda > x=Whoopsie:switch_tabs(x)) >
Ah, it looks like you got what he meant. And to me, when you start having problem with lambda and solves it by doing lambda bindings, that is a good time to move to real functions. > ought to do it. > > Dave > > David J. Giesen | Research Scientist | FPEG US Display OLED Materials R+D > | > Eastman Kodak Company | 2/83/KRL MC02216 | Rochester, NY 14650 | > david.gie...@kodak.com | 1-585-588-0480 Office | > www.kodak.com > > -- -- Guilherme H. Polo Goncalves _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss@python.org http://mail.python.org/mailman/listinfo/tkinter-discuss