jeudi 2 juin 2016

Python, Tkinter : if there a way to check checkboxes by default?

I have this piece of code that will create a simple checkbox :

from Tkinter import *

CheckVar = IntVar()
self.checkbutton = Checkbutton(self.root, text = "Test", variable = CheckVar)

However this checkbox in unchecked by default and I'm searching for a way to check it.

So far I have tried to insert

CheckVar.set(1)

right after CheckVar but it didn't work.

Thanks for your help




Aucun commentaire:

Enregistrer un commentaire