test-kivy-app/kivy_venv/share/kivy-examples/demo/showcase/data/screens/screenmanager.kv

47 lines
1.3 KiB
Plaintext
Raw Normal View History

2024-09-15 12:12:16 +00:00
#:import Factory kivy.factory.Factory
ShowcaseScreen:
name: 'ScreenManager'
fullscreen: True
BoxLayout:
size_hint_y: None
height: '48dp'
Spinner:
text: 'Default transition'
values: ('SlideTransition', 'SwapTransition', 'FadeTransition', 'WipeTransition')
on_text: sm.transition = Factory.get(self.text)()
ScreenManager:
id: sm
Screen:
name: 'screen1'
canvas.before:
Color:
rgb: .8, .2, .2
Rectangle:
size: self.size
AnchorLayout:
Button:
size_hint: None, None
size: '150dp', '48dp'
text: 'Go to screen 2'
on_release: sm.current = 'screen2'
Screen:
name: 'screen2'
canvas.before:
Color:
rgb: .2, .8, .2
Rectangle:
size: self.size
AnchorLayout:
Button:
size_hint: None, None
size: '150dp', '48dp'
text: 'Go to screen 1'
on_release: sm.current = 'screen1'