Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. # alternating push button colour
  2. from guizero import App, PushButton
  3.  
  4. def flash_button():
  5. if warning_button.bg == "white":
  6. warning_button.bg = "black"
  7. app.text_color = "white"
  8. else:
  9. warning_button.bg = "white"
  10. warning_button.text_color = "black"
  11.  
  12. app = App("Flash Button", bg="white")
  13.  
  14. # create an warning button
  15. warning_button = PushButton(app, text="WARNING")
  16. warning_button.repeat(1000, flash_button)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement