Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. # guizero - Variable-sized PushButtons
  2. from guizero import App, Text, PushButton
  3.  
  4. app = App(title="Variable-sized PushButtons")
  5. app.font = "Piboto Condensed"
  6. app.text_size = 40
  7. app.bg = "floral white"
  8.  
  9. # Function definitions go here.
  10. def one_act():
  11. button_one.disable()
  12. button_two.enable()
  13. def two_act():
  14. button_one.enable()
  15. button_two.disable()
  16.  
  17. # GUI widgets & Set up event triggers
  18. button_one = PushButton(app, command=one_act, text="Button one" , align = "left" , width = "fill")
  19. button_two = PushButton(app, command=two_act, text="Button two", align = "right" , height = "fill", enabled=False)
  20. button_one.bg = "dark turquoise"
  21. button_two.bg = "light blue"
  22.  
  23. # Show the GUI on the screen, start listening to events.
  24. app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement