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

Johnny Vestergaard jkv at unixcluster.dk
Thu Jul 30 21:48:44 CEST 2009


Thanks to both Sorin and Cameron for the lambda trick which did the job.


Sorin Schwimmer skrev:
> lambda is your friend:
>
> optiondict[option].bind("<Button>", 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-new Yahoo! Mail.  Click on Options in Mail and switch to New Mail today or register for free at http://mail.yahoo.ca
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
> http://mail.python.org/mailman/listinfo/tkinter-discuss
>
>   



More information about the Tkinter-discuss mailing list