Automatic naming

Mike Olson athos84 at my-deja.com
Mon Jul 31 11:39:39 EDT 2000


I am trying to create a window using Tkinter that has a variable number
of Entry fields, 1 for each item in a list.  My script looks something
like this:

cnt = 0
for x in list:
	label = Label(window, text=x)
	entry = Entry(window)
	label.grid(row=cnt)
	entry.grid(row=cnt, column=1)
	cnt = cnt + 1

The window looks fine, but my problem is that I have no way of using
.get() commands on any of the entry widgets except for the last one.  Is
there a way of automatically naming widgets so that I can use them all,
or of adding tags or something?  If not, does anyone have a suggestion
for a more efficient (or functional) way of doing what I'm doing?  Any
help will be greatly appreciated.

--
Mike Olson
Provis Corporation
Columbia Heights, MN


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list