Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from kivy.app import App
- from kivy.lang import Builder
- KV = '''
- #:import F kivy.factory.Factory
- <MiniPopup@Popup>:
- title: 'mini form!'
- size_hint: None, None
- size:
- (
- self.ids.container.minimum_width + self.border[1] + self.border[3],
- self.ids.container.minimum_height + 60
- )
- BoxLayout:
- id: box
- orientation: 'vertical'
- padding: 20
- spacing: 20
- size_hint: None, None
- size: self.minimum_size
- BoxLayout:
- size_hint: None, None
- size: self.minimum_size
- Label:
- text: 'ip'
- size_hint_x: None
- width: 50
- TextInput:
- size_hint: None, None
- height: self.minimum_height
- width: 200
- multiline: False
- Button:
- text: 'connect'
- size_hint_x: None
- width: self.texture_size[0] + 20
- on_press: root.dismiss()
- Button:
- size_hint_y: None
- height: 48
- text: 'cancel'
- on_press: root.dismiss()
- Button:
- text: 'open form'
- on_press:
- F.MiniPopup().open()
- '''
- class MiniformApp(App):
- def build(self):
- return Builder.load_string(KV)
- if __name__ == '__main__':
- MiniformApp().run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement