Guest User

Untitled

a guest
Aug 28th, 2019
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.95 KB | None | 0 0
  1. from kivy.uix.boxlayout import BoxLayout
  2. from kivy.app import App
  3. from kivy.lang import Builder
  4.  
  5. Builder.load_string('''
  6. <Demo>:
  7.    orientation: 'vertical'
  8.    BoxLayout:
  9.        orientation: 'horizontal'
  10.        height: self.minimum_height
  11.        size_hint_y: None
  12.        Button:
  13.            size_hint_y: None
  14.            height: 100
  15.            pos_hint: {'center_y': 0.5}
  16.            text: '1'
  17.            y: 50
  18.        Button:
  19.            size_hint_y: None
  20.            height: 200
  21.            text: '2'
  22.        Button:
  23.            size_hint_y: None
  24.            pos_hint: {'top': 1}
  25.            height: 300
  26.            text: '3'
  27.        Button:
  28.            size_hint_y: None
  29.            height: 400
  30.            text: '4'
  31.    Button:
  32.        text: 'Remaining space'
  33. ''')
  34.  
  35.  
  36. class Demo(BoxLayout):
  37.     pass
  38.  
  39.  
  40. class DemoApp(App):
  41.     def build(self):
  42.         return Demo()
  43.  
  44.  
  45. if __name__ == '__main__':
  46.     DemoApp().run()
Advertisement
Add Comment
Please, Sign In to add comment