The checkbox is an onoff flipflop toggle

The great thing about the checkbox graphical interface element is that it can be in only one of two states, either on or off. Depending on the current state of the checkbox, an object can be set to either 1 for "on" or 0 for "off."

Click checkbox to -t ^t the object to

(CHck the checkbox to "┬╗tick" it and set the object to VPf".

(CHck the checkbox to "┬╗tick" it and set the object to VPf".

In tkinter, checkboxes are created using Checkbutton (), and they can be associated with a tkinter IntVar, first introduced in Chapter 7. The tkinter Checkbutton () is either on or off and sets the associated IntVar to either 1 or 0, which is perfect for what you need.

Let's look at using a checkbox in tkinter.

flip it off

Was this article helpful?

0 0

Post a comment