Sorin Schwimmer wrote: > Is it possible to have a widget id while it is created?
no, because the arguments to the constructor are evaluated *before* the constructor is called. > Something like this: > > Button(root, text='...', command= lambda v=<widget id>: fn(v)).grid() use lexical scoping: b = Button(root, text='...', command=lambda: fn(b)) b.grid() or, if you're doing this in a loop: b = Button(root, text='...') b.config(command=lambda b=b: fn(b)) b.grid() </F> _______________________________________________ Tkinter-discuss mailing list [email protected] http://mail.python.org/mailman/listinfo/tkinter-discuss
