0

We have a spinner in our code and need to assign a value to the selection so we can use it later.

    GridLayout:
        cols: 2
        Label:
            font_size: '48sp'
            text: "[color=000000][sub]Select a sport:[/sub][/color]"
            halign: 'left'
            valign: 'middle'
            markup: True
            text_size: self.size

        Spinner:
            text: 'Select a sport'
            values: ('Soccer', 'Basketball', 'Volleyball', 'Handball')
            size: (100,44)
gellinjm
  • 1
  • 1

1 Answers1

0

The spinner gives several options that, when selected, will replace its text. So if you select 'Basketball', its text property will be 'Basketball'. You can access the value this way.

inclement
  • 29,124
  • 4
  • 48
  • 60