I am trying to link each individual checkbutton to a specific entrybox using function. but i have no idea how to name each individual checkbuttons. coding is new to me and i need help desperately...
tried using a function found online but only the last entrybox is affected the checkbuttons
from tkinter import *
#initialise intial window, root
root = Tk()
dishes = Text(root, cursor="arrow")
qty = Text(root, cursor="arrow")
dishes.pack(side=RIGHT)
qty.pack(side=LEFT)
#to display a entrybox each row
for i in range(10):
ent = Entry(root, width=3, state='disabled')
qty.window_create("100.0", window=ent)
qty.insert("end", "\n")
##to display a checkbutton each row
for key in range(10):
var = IntVar(value=0)
cb = Checkbutton(dishes, text="%d" % key,
variable=var, onvalue=1, offvalue=0)
dishes.window_create("end", window=cb)
dishes.insert("end", "\n")
root.mainloop()