Spinner Widget in the kivy Library of PythonKivy is the Graphical User Interface tool in Python, which is platform independent. The applications developed using Kivy can be used on IOS, Windows, Linux, and Android operating systems. The basic use of the Kivy tool in developing applications for the Android operating system but it can also be used for developing desktop applications. Spinner Widget:The users can import the spinner widget of the kivy library by using the following command: A spinner widget is used for selecting one value from a set. In the default state, a spinner shows its currently selected value. When the user clicks on the spinner, it displays a dropdown menu that shows all the other available values from which the user can select. Like a combo-box, the spinner widget is also used for giving the multiple-choice option to the user for selecting anyone of its menu. The user can also attach a callback to the spinner widget for receiving the notifications on the selection of the value from the widget menu. Approach:
Example:Output: Image 1: Image 2: Now, we have to display which of the option in the menu list is selected currently. We can display the label just beside the spinner widget. Example 2:Output: Image 1: Image 2: ConclusionIn this tutorial, we have discussed implementing a spinner widget of the kivy library in the Python application for giving the option of selecting the element from the menu to the users. |
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/263407.html