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?
- Convert Text and Text File to PDF using Python
- Python: Convert Speech to text and text to Speech
- Zip function in Python to change to a new character set
- Python | Ways to change keys in dictionary
- Change current working directory with Python
- Text Analysis in Python 3
- Text Preprocessing in Python | Set 2
- Text detection using Python
- Python | Merge two text files
- Tokenize text using NLTK in python
- Python | Tokenize text using TextBlob
- Convert Text to Speech in Python
- Python PIL | ImageDraw.Draw.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 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.