Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # create a series of widgets each with a different alignment
- from guizero import App, PushButton, Text, Box
- app = App(title="align")
- title_box = Box(app, width="fill", align="top", border=True)
- title_box.bg = "blue"
- top_text = Text(title_box, text="at the top", align="top")
- top_text.bg = "yellow"
- footer_box = Box(app, width="fill", align="bottom", border=True)
- footer_box.bg = "orange"
- bottom_text = Text(footer_box, text="at the bottom", align="bottom")
- bottom_text.bg = "green"
- left_box = Box(app, width="fill", align="left", border=True)
- left_box.bg = "aqua"
- left_text = Text(left_box, text="to the left", align="left")
- left_text.bg = "pink"
- left_text_1 = Text(left_box, text="to the left again", align="left")
- left_text_1.bg = "gray"
- right_box = Box(app, width="fill", align="right", border=True)
- right_box.bg = "purple"
- right_text = Text(right_box, text="to the right", align="right")
- right_text.bg = "silver"
- app.display()
Advertisement
Add Comment
Please, Sign In to add comment