Kivy — it is a platform independent GUI tool in Python. Since it can run on Android, IOS, Linux, Windows, etc. It is mainly used to develop Android application, but that does not mean that it cannot be used in desktop applications.
To work with a spinner, you need to import:
from kivy.uix.spinner import Spinner
Spinner — it is a widget that provides a quick way to select one value from a set. In the default state, the counter shows its currently selected value. Touching the counter displays a drop-down menu with all other available values from which the user can select a new one.
As with the combo box, the counter object can have multiple values, and you can select one of the values.
A callback can be attached to the spinner object to receive notifications about the selection of a value from the spinner object.
Basic Approach: 1) import kivy 2) import kivyApp 3) import spinner 4) import Floatlayout (according to need) 5) import window (optional) 6) Set minimum version (optional) 7) Create Layout class: define the clicked function in it 8) Create App class 9) create .kv file (name same as the app class): 1) create Spinner 2) create callback 3) And many more styling as needed 10) return Layout / widget / Class (according to requirement) 11) Run an instance of the class
Below is the implementation:
In the code below, we created a spinner, performed resizing and positioning, and attached a callback to the values.
Image 2: strong>
Below here is the output in the video to understand better: