Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Under 'PushButton control', this demo resizes (and colours) the h1 heading
- # and switches in and out of FULL SCREEN mode
- from guizero import App, Text, Box, PushButton
- app = App(title="REsize")
- app.bg ="cyan"
- fullSize = True #
- def changeSize():
- global fullSize
- fullSize = not(fullSize) # toggle
- if (fullSize):
- sizingButton.text = "EXIT Full Screen mode"
- h1.text_size = 30
- h1.width = 40
- h1.text_color = "red"
- app.set_full_screen()
- else:
- sizingButton.text = "ENTER Full Screen mode"
- h1.text_size = 20
- h1.width = 26
- h1.text_color = "black"
- app.exit_full_screen()
- vertSpace01 = Text(app, text=" ", width="fill", size=12 )
- h1 = Text(app, text="Header text - resizes", align="top")
- h1.bg = "white"
- box1 = Box(app)
- box1.bg = "#FE3456"
- a_text = Text(box1, text="Same size ..?", align="bottom")
- sizingButton = PushButton(app, text='GO !', command= changeSize )
- sizingButton.bg = "#EE66EE"
- sizingButton.text_color = "white"
- sizingButton.text_size = 20
- changeSize() # set initial config
- app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement