dimanche 5 avril 2015

How to create a function to select all checkbuttons?

I created a list of checkbutton in Python with TkInter and try to select all checkbutton with a function select_all. Can anyone help me. Thanks in advance.



def tools():
fp = LabelFrame(ft, text="Tool1")
P1 = Checkbutton(fp, text = "1", variable = v1)
P2 = Checkbutton(fp, text = "2", variable = v2)
def officetools():
fo = LabelFrame(ft, text="Tool2")
O1 = Checkbutton(fo, text = "3", variable = v3)
O2 = Checkbutton(fo, text = "4", variable = v4)
def select_all():
for variable in Checkbutton:
variable.select()




Aucun commentaire:

Enregistrer un commentaire