test-kivy-app/kivy_venv/share/kivy-examples/widgets/spinner.py
2024-09-15 15:12:16 +03:00

18 lines
421 B
Python

from kivy.uix.spinner import Spinner
from kivy.base import runTouchApp
spinner = Spinner(
text='Home',
values=('Home', 'Work', 'Other', 'Custom'),
size_hint=(None, None), size=(100, 44),
pos_hint={'center_x': .5, 'center_y': .5})
def show_selected_value(spinner, text):
print('The spinner', spinner, 'has text', text)
spinner.bind(text=show_selected_value)
runTouchApp(spinner)