How can I access to the kivy data from MyScreenManager ? How can I access to Hellow or Timer data ? I cant use on_release: root.starttimer() in Hellow.
class Hellow(Screen):
pass
class Timer(Screen):
pass
class MyScreenManager(ScreenManager):
def starttimer(self):
#change text Hellow Button
root_widget = Builder.load_string('''
#:import FadeTransition kivy.uix.screenmanager.FadeTransition
MyScreenManager:
transition: FadeTransition()
Hellow:
Timer:
<Hellow>:
AnchorLayout:
Button:
id: but
size_hint: None, None
size:300,100
text: 'make a foto'
font_size: 30
on_release: app.root.starttimer()
<Timer>:
name: 'Timer'
''')
class ScreenManagerApp(App):
def build(self):
print(self.ids)
return root_widget
if __name__ == '__main__':
ScreenManagerApp().run()
some text for stackoverflow (it says that I need to type more text),
Screen manager is only used to accept screen widgets if you try to add anything else like a button or label then it will throw an exception.
kivy.uix.screenmanager.ScreenManagerException: ScreenManager accepts only Screen widget.
Only one root object is allowed by .kv file In your case, you can access hello or Timer from each other.but there could be another way too.
EDIT 1:
As you asked in your comment