Advertisement
timber101

GUIZERO - Worst GUI

Jul 22nd, 2021
1,371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.09 KB | None | 0 0
  1. #  worlds worst GUI by colin
  2. #  how NOT to make a GUI
  3.  
  4. from guizero import App, Text, Combo, PushButton
  5. from string import ascii_letters
  6.  
  7. app = App("It' all gone wrong", bg = "dark green")
  8.  
  9. def flash_text():
  10.     if title.visible:
  11.         title.hide()
  12.     else:
  13.         title.show()
  14.        
  15. def are_you_sure():
  16.     if app.yesno("Confirmation", "Are you sure?"):
  17.         app.info("Thanks", "Button pressed")
  18.     else:
  19.         app.error("Ok", "Cancelling")
  20.        
  21.  
  22.  
  23. title = Text(app, text= "Some hard text to read", size = "14", font = "Comic Sans", color = "green")
  24.  
  25. a_letter = Combo(app, options = " " + ascii_letters, align ="left")
  26. b_letter = Combo(app, options = " " + ascii_letters, align ="left")
  27. c_letter = Combo(app, options = " " + ascii_letters, align ="left")
  28. d_letter = Combo(app, options = " " + ascii_letters, align ="left")
  29. e_letter = Combo(app, options = " " + ascii_letters, align ="left")
  30.  
  31. button = PushButton(app, command = are_you_sure)
  32.  
  33. app.warn("Application started", "Well done you started the applicatioon")
  34.  
  35. app.repeat(1000, flash_text)
  36.  
  37. app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement