from kivy.app import App
from kivy.lang import Builder
from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition
class MainScreen(Screen):
pass
class AnotherScreen(Screen):
pass
class ScreenManagement(ScreenManager):
pass
presentation = Builder.load_file("test.kv")
class MainApp(App):
def build(self):
return presentation
MainApp().run()
ScreenManagement:
# transition: FadeTransition()
MainScreen:
AnotherScreen:
:
name: 'main'
Button:
on_release: app.root.current = 'other'
text: 'Another Screen'
font_size: 50
:
name: 'other'
Button:
on_release: app.root.current = 'main'
text: 'back to the home screen'
font_size: 50
from kivy.lang import Builder
from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition
class MainScreen(Screen):
pass
class AnotherScreen(Screen):
pass
class ScreenManagement(ScreenManager):
pass
presentation = Builder.load_file("test.kv")
class MainApp(App):
def build(self):
return presentation
MainApp().run()
ScreenManagement:
# transition: FadeTransition()
MainScreen:
AnotherScreen:
name: 'main'
Button:
on_release: app.root.current = 'other'
text: 'Another Screen'
font_size: 50
name: 'other'
Button:
on_release: app.root.current = 'main'
text: 'back to the home screen'
font_size: 50
Geen opmerkingen:
Een reactie posten