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.
- Python | Tkinter ttk.Checkbutton and comparison with simple Checkbutton
- Why Python is called Dynamically Typed?
- Zip function in Python to change to a new character set
- Python | Ways to change keys in dictionary
- Text Preprocessing in Python | Set 2
- Text Analysis in Python 3
- Python | Tokenize text using TextBlob
- Tokenize text using NLTK in python
- Convert Text to Speech in Python
- Python | Change column names and row indexes in Pandas DataFrame
- Formatted text in Linux Terminal using Python
- Textwrap – Text wrapping and filling in Python
- Python Text To Speech | pyttsx module
- Reading and Writing to text files in Python
- Python | Scramble words from a text file
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.