Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. import toga
  2. from colosseum import CSS
  3.  
  4. class StartApp(toga.App):
  5. def startup(self):
  6. self.main_window = toga.MainWindow(self.name)
  7. self.main_window.app = self
  8.  
  9. self.input_box = toga.Box()
  10.  
  11. multiple_input = toga.Box(style=CSS(flex_direction='row', margin=10))
  12. m_label = toga.Label('Multiple Text Input: ')
  13. self.m_input = toga.MultilineTextInput('OLAR')
  14.  
  15. multiple_input.add(m_label)
  16. multiple_input.add(self.m_input)
  17.  
  18. self.input_box.add(multiple_input)
  19.  
  20. self.control_box = toga.Box()
  21.  
  22. update_tree_button = toga.Button('Update Tree',
  23. on_press=self.callbackUpdate)
  24.  
  25. self.control_box.add(update_tree_button)
  26.  
  27. frame = toga.SplitContainer()
  28. frame.content = [self.input_box, self.control_box]
  29.  
  30. self.main_window.content = frame
  31. self.main_window.show()
  32.  
  33. def callbackUpdate(self, event):
  34. self.m_input.clear()
  35.  
  36. def main():
  37. app = StartApp('MultilineTextInput Test', 'org.pybee.test')
  38. app.main_loop()
  39.  
  40. if __name__ == '__main__':
  41. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement