Kivy is a platform independent GUI tool in Python. As it 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 Desktops applications.
To work with the slider you first have to import the module which consists all featuers, functions of the slider i.e.
The Slider widget looks like same we are using in android to increase the brightness, volume etc. It supports horizontal and vertical orientations, min/max values and a default value. Kivy supports several slider widget options for customizing the cursor, cursor image, border, background to be used in different orientations, region between the minimum value and the maximum value.
Kivy also supports to deal in term of Normalized value (range 0 to 1) rather than the real ranges supported by the slider.
Basic Approach to follow while creating Slider :
1) import kivy
2) import kivy App
3) import gridlayout(not compulsory according to need)
4) import Label(not compulsory according to need)
5) import Slider
6) import Numeric property
7) set minimum version(optional)
8) Extend the class
9) Add and return a widget
10) Run an instance of the class
Below is the code implementing slider:
To add some styling and coloring to the slider, just replace the line no 42 with the below and add some new features also if you want. For text, styling uses the proper commands in text portion.
Video to explain how slider works –
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.