Re: [Tkinter-discuss] Passing arguments to command in button.bind

2009-07-30 Thread Johnny Vestergaard
Thanks to both Sorin and Cameron for the lambda trick which did the job. Sorin Schwimmer skrev: lambda is your friend: optiondict[option].bind("", lambda t='this is a string i want to pass': self.newdestination(t)) HTH SxN __

Re: [Tkinter-discuss] Passing arguments to command in button.bind

2009-07-29 Thread Sorin Schwimmer
lambda is your friend: optiondict[option].bind("", lambda t='this is a string i want to pass': self.newdestination(t)) HTH SxN __ Be smarter than spam. See how smart SpamGuard is at giving junk email the boot with the All-ne

Re: [Tkinter-discuss] Passing arguments to command in button.bind.

2009-07-28 Thread Cameron Laird
On Tue, Jul 28, 2009 at 02:04:52PM +0200, jkv wrote: . . . > Im playing around with Tkinter and cant figure out how to pass arguments > to a def which are called when pressing a button. > When i bind to self.newdestination('wha

[Tkinter-discuss] Passing arguments to command in button.bind.

2009-07-28 Thread jkv
Hi, Im playing around with Tkinter and cant figure out how to pass arguments to a def which are called when pressing a button. When i bind to self.newdestination('whatever') the def is called (with arguments) as soon as the button is drawn, whereas when i bind to self.newdestination the function i