Pregunta

I was wondering whether it was possible to displays kivy spinner values as a moving label, so that the user knows exactly what the current value of the slider is.

Thanks

¿Fue útil?

Solución

you just bind a listener to the value change event

some_label = Label(...)
my_slider = Slider(...)
def OnSliderValueChange(instance,value):
    some_label.text = str(value)

my_slider.bind(value=OnSliderValueChange)

as inclement points out in the .kv file you could do something like

<PongGame>:
    ...
    canvas:
        Rectangle:
            ...
    Label:
        ...
        text: str(slider_id.value)
     Slider:
        ...
        id: slider_id
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top