What I want to know?
- If button with id: button_b (Get_Boys class) is released, then Label with id: label_g (Get_Girls class) must change.
- If Button with id: button_b (Get_Boys class) is pressed, then Label with id: root_lbl (Get_People class) must change.
- If Button with id: root_btn (Get_People class) is released, then Label with id: label_b (Get_Boys class) must change.
It is explained (little) in this link, but not from the beginner's point of view.
I have 2 files
- test.py
- dates_test.kv
test.py
class Get_People(BoxLayout):
pass
class Get_Boys(BoxLayout):
pass
class Get_Girls(BoxLayout):
pass
class TestApp(App):
def build(self):
self.load_kv('dates_test.kv')
return Get_People()
dates_test.kv file
<Get_People>:
orientation: 'vertical'
Button:
name: root_btn
id: root_btn
text: "I am Root Button"
on_release: change_label_b
Label:
id: root_lbl
text: "I am Root Label"
Get_Boys:
Get_Girls:
<Get_Boys>:
Button:
id: button_b
text: "Button for boys"
on_press: change_label_root
on_release: change_label_g
Label:
id: label_b
text: "Label for boys"
<Get_Girls>:
Button:
id: button_g
text: "Button for girls"
Label:
id: label_g
text:"Label for girls"