Advertisement
john_feleppa

GUIs 2.6

Aug 19th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 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. # create a series of widgets each with a different alignment
  7. top_text = Text(app, text="at the top", align="top")
  8. bottom_text = Text(app, text="at the bottom", align="bottom")
  9. left_text = Text(app, text="to the left", align="left")
  10. left_text_1 = Text(app, text="to the left again", align="left")
  11. right_text = Text(app, text="to the right", align="right")
  12.  
  13. box = Box(app, width="fill", height="fill", border=1)
  14. box.bg = "orange"
  15. box_text_top = Text(box, text="box top", align="top")
  16. box_text_left = Text(box, text="box left", align="left")
  17. box_text_right = Text(box, text="box right", align="right")
  18. box_text_right_1 = Text(box, text="box right again", align="right")
  19. box_text_bottom = Text(box, text="box bottom", align="bottom")
  20.  
  21. app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement