Python Forum
[Tkinter] apply command on every list element
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] apply command on every list element
#2
I would use an IntVar instead of trying to talk directly to the Entry objects.
squares = []
for r in range(9):
    y = 80 + r * 40
    for c in range(9):
        var = IntVar()
        squares.append(var)
        x = 70 + c * 40
            t= tk.Entry(fenster, font=("Times New Roman",12), textvars=var)
            t.place(x=x, y=y, width=40, height=40)
Then you could use square[index].set(value) or square[index].get()
Reply


Messages In This Thread
apply command on every list element - by flash77 - May-12-2020, 06:31 PM
RE: apply command on every list element - by deanhystad - May-12-2020, 10:49 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020