2

I have created a list of 20 check buttons for my last application using Tkinter, but I can't figure out the way to check if a Checkbutton is or not checked.

How do I check if a Checkbutton is checked?

nbro
  • 13,796
  • 25
  • 99
  • 185
Yu Zhang
  • 1,947
  • 5
  • 25
  • 38

1 Answers1

2

Take a look at this answer: Making Menu options with Checkbutton in Tkinter?

For each of the menu item, you need to create and associate a tk.BooleanVar() that matches the status of the checkbox.

Since you have a lot of check buttons, you might want to create a list or dictionary to store these BooleanVars and associate each of them with its own Checkbutton.

Community
  • 1
  • 1
zehnpaard
  • 5,623
  • 2
  • 24
  • 40