using dot notation

id-s referred by dot notation
This commit is contained in:
picibucor 2015-05-11 07:59:14 +02:00
parent 6917d94813
commit 4a7e6ddc2a
1 changed files with 3 additions and 3 deletions

View File

@ -17,12 +17,12 @@ class RootWidget(BoxLayout):
# print out the given parameter
print(status)
# check the status of the switch by referring on the id
if self.ids['my_switch'].active is True:
if self.ids.my_switch.active is True:
# set the text of the label by referring on the id
self.ids['my_label'].text = 'Switch is ON'
self.ids.my_label.text = 'Switch is ON'
else:
# set the text of the label by referring on the id
self.ids['my_label'].text = 'Switch is OFF'
self.ids.my_label.text = 'Switch is OFF'
class TestApp(App):