mercredi 25 juillet 2018

Creating Checkbox From a List or Dict with Tkinter

I have a dict that contains data and I need to create a checkbox. But because this dict is editable I don't know its contents of it in real life so I need something like a for loop. But while the structure of tkinter checkbox program like

CheckVar1 = IntVar()
CheckVar2 = IntVar()
C1 = Checkbutton(top, text = "Music", variable = CheckVar1, \
             onvalue = 1, offvalue = 0, height=5, \
             width = 20, )
C2 = Checkbutton(top, text = "Video", variable = CheckVar2, \
             onvalue = 1, offvalue = 0, height=5, \
             width = 20)

this I have no idea how to do it. Also I need to check which one is checked and which one is not, then create a list from them.

Thanks.




Aucun commentaire:

Enregistrer un commentaire