Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from guizero import Box, App, PushButton, TextBox, Text, Slider
- #main app
- app = App()
- #function
- def refresh():
- box_header.width = sld_size.value
- box_header.height = sld_size.value
- box_body.width = box_header.width * 2
- box_body.height = box_header.height * 2
- box_footer.width = box_body.width * 2
- box_footer.height = box_body.height * 2
- box_four.width = box_footer.width * 2
- box_four.height = box_footer.height * 2
- app.height = 100 + box_header.height + box_body.height + box_footer.height + box_four.height
- #widgets
- lbl_size = Text(app, text="Choose a size for your tower (1-5):")
- sld_size = Slider(app, start=1, end=50, width="fill", height=20)
- btn_refresh = PushButton(app, text="refresh", command=refresh)
- #three boxes
- box_header = Box(app, align="top", border=0)
- box_header.bg = "dark blue"
- box_body = Box(app, align="top", border=0)
- box_body.bg = "blue"
- box_footer = Box(app, align="top", border=0)
- box_footer.bg = "sky blue"
- box_four = Box(app, align="top", border=0)
- box_four.bg = "light blue"
- app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement