Earlier I was having trouble with changing the state of one entry. That was solved by using .grid()
on a new line but when I altered this in my program it only changed one of the entries.
from tkinter import *
def changestate():
global entry1
entry1['state']='normal'
root=Tk()
entry1_list=[]
def newday():
global entry1
row=0
for i in range(0,5):
var=IntVar()
entry1=Entry(root,width=3,bd=4,textvariable=var,state='disabled')
entry1.grid(row=row,column=1)
entry1_list.append(var)
row=row+1
button1=Button(root,text='Change state',command=changestate).grid(row=row,column=1)
newday()
root.mainloop()
It is meant to change the state of all the entries to normal when the button is clicked however it only changes the last one.
I am using the same name for the entries because I don't want to type them out multiple times in my program as it would make it very long and I would not be able to let the user input the number of entries they want to appear.
Is there a way I can refer each entry1
individually so that this will work?