Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from guizero import App, Text,Box
- # this time we have not set the layout to auto as it is default
- app = App(title="align")
- top_box = Box(app, align="top")
- top_box.bg = 'yellow'
- bottom_box = Box(app, align="bottom")
- bottom_box.bg ='blue'
- left_box = Box(app, align="left")
- left_box.bg = 'Red'
- right_box = Box(app, align="right")
- right_box.bg = 'Green'
- # create a series of widgets each with a different alignment
- top_text = Text(top_box, text="at the top", align="top", width="10", height="5")
- bottom_text = Text(bottom_box, text="at the bottom", align="bottom", width="10", height="5")
- left_text = Text(left_box, text="to the left", align="left", width="10", height="5")
- right_text = Text(right_box, text="to the right", align="right", width="10", height="5")
- app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement