Advertisement
Mori007

myaligngui

Feb 8th, 2021
702
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.78 KB | None | 0 0
  1. from guizero import App, Text,Box
  2.  
  3. # this time we have not set the layout to auto as it is default
  4. app = App(title="align")
  5.  
  6. top_box = Box(app, align="top")
  7. top_box.bg = 'yellow'
  8. bottom_box = Box(app, align="bottom")
  9. bottom_box.bg ='blue'
  10. left_box = Box(app, align="left")
  11. left_box.bg = 'Red'
  12. right_box = Box(app, align="right")
  13. right_box.bg = 'Green'
  14.  
  15. # create a series of widgets each with a different alignment
  16.  
  17. top_text = Text(top_box, text="at the top", align="top", width="10", height="5")
  18. bottom_text = Text(bottom_box, text="at the bottom", align="bottom", width="10", height="5")
  19. left_text = Text(left_box, text="to the left", align="left", width="10", height="5")
  20. right_text = Text(right_box, text="to the right", align="right", width="10", height="5")
  21.  
  22. app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement