On Fri, 5 May 2006 11:04:20 +0300
"Ilknur Ozturk" <[EMAIL PROTECTED]> wrote:
> Hi all,
>
>
>
> I prepared a GUI which contains lots of buttons. Instead of defining
> each of them one by one, I want to write a function that gets the
> parameters and create a button.(Each one calls same function for
> buttonclick event) Is it possible? If it is, can you give me a simple
> example?
>
Hi Ilknur,
maybe you mean something like
buttons = []
r = 0
c = 0
for i in range(100):
b = Button(master, text=i, **kw)
b.grid(row=r, column=c)
buttons.append(b)
c += 1
if c > 10:
c = 0
r += 1
I hope this helps
Michael
_______________________________________________
Tkinter-discuss mailing list
[email protected]
http://mail.python.org/mailman/listinfo/tkinter-discuss