Python | Checkbox widget in Kivy
Kivy is a platform independent GUI tool in Python. Kivy applications can be run on Android, IOS, linux, and Windows, etc. It is basically used to develop the Android application, but it does not mean that it can not be used on Desktop applications.
Checkbox widget –
CheckBox is a specific two-state button that can be either checked or unchecked. Checkboxes have an accompanying label that describes the purpose of the checkbox. Checkboxes can be grouped together to form radio buttons. Checkboxes are used to convey whether a setting is to be applied or not.
To work with the Checkbox, you first have to import Checkbox from the module which consists all features, functions of the slider i.e.
from kivy.uix.checkbox import CheckBox
Basic Approach to follow while creating Slider :
1) import kivy 2) import kivy App 3) import gridlayout 4) import Label 5) import Checkbox 6) import Widget 7) set minimum version(optional) 8) Extend the class 9) Add widget in the class 10) Create the App class 11) run the instance of the class
Now the program of How to create Checkbox in Kivy:
Now Question is that How can we bind or attach callback to Checkbox?
So the simple example is given which bind Checkbox with the click i.e when it clicked it print “Checkbox Checked” else it will print “Checkbox unchecked”.
Now program to arrange a callback to Checkbox i.e whether checkbox is checked or not.
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. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course