dynamic buttons with tkinter

Mirko Koenig koenig at v-i-t.de
Sat Jun 29 16:17:17 EDT 2002


Hi

In my i want to make a button for every file
in a special directory, so that i can load it.
I did:
 
 for file in os.listdir( dir ):
        Button( load_dlg_frame, text=file, relief=GROOVE, 
		command=load).pack()

But how can i find out which button is pressed?
Or another question: How can i pass a event funktion more than 1
parameter (the event and other things).
I can't give any button a new event function, because it's dynamic,
because of the number of files in the directory.

thanx 

Mirko



More information about the Python-list mailing list