I try to update the text of an label continuously by using
Clock.schedule_interval.
In this example I got the following error message:
NameError: global name 'radio_station' is not defined
And I don't know why. Can some help me?
Thanks a lot.
kv-file:
<CtrlRadio>:
radio_station: stationName
BoxLayout:
orientation: "vertical"
Label:
id: stationName
text:"default text"
python file:
class CtrlRadio(Widget):
radio_station = StringProperty()
def print_info_to_display(self):
radio_station.text = "Radio Station"
# start scheduling - 500ms
Clock.schedule_interval(print_info_to_display, 0.5)
class RadioApp(App):
def build(self):
return CtrlRadio()
if __name__ == '__main__':
RadioApp().run()