Skip to content

Instantly share code, notes, and snippets.

@Kovak
Created July 15, 2013 05:08
Show Gist options
  • Save Kovak/5997629 to your computer and use it in GitHub Desktop.
Save Kovak/5997629 to your computer and use it in GitHub Desktop.
from kivy.app import App
from kivy.uix.widget import Widget
class RootWidget(Widget):
pass
class TestApp(App):
def build(self):
pass
if __name__ == '__main__':
TestApp().run()
RootWidget:
<RootWidget>:
FloatLayout:
size: root.size
pos: root.pos
BoxLayout:
text1: text1
orientation: "vertical"
size_hint_y: None
height: 120
padding: (0, (self.height - text1.texture_size[1]*4)/2)
canvas:
Color:
rgb: 1, 0, 0
Rectangle:
pos: self.pos
size: self.size
Label:
id: text1
text: '1'
halign: "left"
valign: "top"
size_hint: (None, None)
size: self.texture_size
Label:
text: '2'
halign: "left"
valign: "middle"
color: (0, 1, 0, 1)
size_hint: (None, None)
size: self.texture_size
Label:
halign: "left"
valign: "middle"
text: '3'
size_hint: (None, None)
size: self.texture_size
Label:
halign: "left"
valign: "bottom"
text: '4'
size_hint: (None, None)
size: self.texture_size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment