Advertisement
Guest User

Untitled

a guest
May 21st, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. from kivy.app import App
  2. from kivy.lang import Builder
  3.  
  4. KV = '''
  5. #:import F kivy.factory.Factory
  6.  
  7. <MiniPopup@Popup>:
  8. title: 'mini form!'
  9. size_hint: None, None
  10. size:
  11. (
  12. self.ids.container.minimum_width + self.border[1] + self.border[3],
  13. self.ids.container.minimum_height + 60
  14. )
  15.  
  16. BoxLayout:
  17. id: box
  18. orientation: 'vertical'
  19. padding: 20
  20. spacing: 20
  21. size_hint: None, None
  22. size: self.minimum_size
  23.  
  24. BoxLayout:
  25. size_hint: None, None
  26. size: self.minimum_size
  27.  
  28. Label:
  29. text: 'ip'
  30. size_hint_x: None
  31. width: 50
  32.  
  33. TextInput:
  34. size_hint: None, None
  35. height: self.minimum_height
  36. width: 200
  37. multiline: False
  38.  
  39. Button:
  40. text: 'connect'
  41. size_hint_x: None
  42. width: self.texture_size[0] + 20
  43. on_press: root.dismiss()
  44.  
  45. Button:
  46. size_hint_y: None
  47. height: 48
  48. text: 'cancel'
  49. on_press: root.dismiss()
  50.  
  51. Button:
  52. text: 'open form'
  53. on_press:
  54. F.MiniPopup().open()
  55. '''
  56.  
  57.  
  58. class MiniformApp(App):
  59. def build(self):
  60. return Builder.load_string(KV)
  61.  
  62.  
  63. if __name__ == '__main__':
  64. MiniformApp().run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement