Tkinter is a GUI (Graphical User interface) module which is used to create various types of applications. It comes along with the Python and consists of various types of widgets which can be used to make GUI more attractive and user-friendly. Checkbutton is one of the widgets which is used to select multiple options.
Checkbutton can be created as follows:
chkbtn = ttk.Checkbutton(parent, value = options, ...)
Output #1: When you run application you see the initial states of Checkbutton as shown in output.
Output #2: As soon as you select the Checkbutton you’ll see that text has been changed as in output.
Output #3: When you deselect the Checkbutton you’ll again observe following changes.
Code #2: Commands can be integrate with the Checkbutton which can be execute when checkbutton is selected or deselected depending upon conditions.
Note: In above code offvalue and onvalue are used to set the values of Checkbutton of non-selected state and selected state respectively.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Python | Tkinter ttk.Checkbutton and comparison with simple Checkbutton
- Python Tkinter - Checkbutton Widget
- Why Python is called Dynamically Typed?
- How to Dynamically Load Modules or Classes in Python
- Create Classes Dynamically in Python
- wxPython - Dynamically enable and disable tools in toolbar using button
- Dynamically Resize Buttons When Resizing a Window using Tkinter
- Python: Convert Speech to text and text to Speech
- Convert Text and Text File to PDF using Python
- PyQt5 – How to change text of pre-existing label | setText method
- PyQt5 – How to change font and size of Label text ?
- PyQt5 – How to change the text of existing push button ?
- PyQt5 – Change the text font and size in Push button
- PyQt5 - How to change style and size of text Progress Bar ?
- PyQt5 – Change text in Radio Button on click
- PyQt5 - How to change the spacing between indicator and text part of Radio Button ?
- PyQt5 - Change text of pre-existing Radio button
- Change the color of certain words in the tkinter text widget
- wxPython - Change font for text present in Radio Box
- How to change the Tkinter label text?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.