Skip to content

Instantly share code, notes, and snippets.

@inclement
Created November 23, 2020 23:15
Show Gist options
  • Save inclement/61130f656868f00881a63c2308d8426f to your computer and use it in GitHub Desktop.
Save inclement/61130f656868f00881a63c2308d8426f to your computer and use it in GitHub Desktop.
import kivy
kivy.require('1.10.1')
from kivy.lang import Builder
from kivy.app import App
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.core.window import Window
kv = """
<SetupScreen>:
BoxLayout:
orientation: 'horizontal'
BoxLayout:
orientation: 'vertical'
Label:
text: 'Links'
Widget:
BoxLayout:
orientation: 'vertical'
Label:
text: 'Mitte'
Widget:
BoxLayout:
orientation: 'vertical'
Label:
text: 'Rechts'
size_hint_y: None
height: 30
Widget:
Button:
text: 'Drück mich!'
size_hint_y: None
height: 30
<RunScreen>:
BoxLayout:
orientation: 'vertical'
padding: 20
Label:
text: 'Lorem'
Label:
text: 'Ipsum'
<SummaryScreen>:
BoxLayout:
Label:
text: 'Und vorbei...'
"""
class SetupScreen(Screen):
pass
class ControllerApp(App):
def __init__(self, **kwargs):
self.title = "Controller"
super().__init__(**kwargs)
def build(self):
Builder.load_string(kv)
# self.root = Builder.load_file('screens.kv')
sm = ScreenManager()
sm.add_widget(SetupScreen(name='setup'))
return sm
if __name__ == "__main__":
Window.size = (800, 480)
ControllerApp().run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment