AaronJPung
AaronJPung

Reputation: 1132

How can I check a checkbox in Python's Tkinter grid

I have a checkbox on a GUI, using the following script:

# Define checkbox
CheckVar1 = IntVar()
C1 = Checkbutton(tab2, text = "NW", variable = CheckVar1, onvalue = 1, offvalue = 0)

# Place checkbox on GUI
C1.grid(column=0, row=4)

What command can I use to check the box, if a certain condition is met?

Upvotes: 0

Views: 114

Answers (1)

Bryan Oakley
Bryan Oakley

Reputation: 385940

Call the set method of the associated varible:

CheckVar1.set(1)

Upvotes: 1

Related Questions