[Tkinter-discuss] creating widgets generically, with a loop?

Fredrik Lundh fredrik at pythonware.com
Wed Jun 21 17:31:31 CEST 2006


Mike Steiner wrote:

> Does this work - does the "command=" parameter allow the function
> value to contain parameters too? If so, it would solve the problem
> easily!

the code *calls* the given method, and passes the return value (in this 
case, an instance of the inner function) to the Button constructor.

</F>

> --- Martin Franklin <mfranklin1 at gatwick.westerngeco.slb.com> wrote:
>> [ stuff omitted ]
>> for text, external, filename in my_buttons:
>>    b = Button(self, text=text, command=self.launchit(external,
>> filename))
>>    b.grid()
> 
> 
> Michael Steiner
> MikeJaySteiner at yahoo.com
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 



More information about the Tkinter-discuss mailing list