Guest User

Untitled

a guest
Nov 8th, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | None | 0 0
  1. # Import the GUI widgets that you'll be using, and create the 'app' for your program.
  2. from guizero import App, TextBox, PushButton, Text, info
  3. app = App()
  4.  
  5. # Function definitions for your events go here.
  6. def btn_go_clicked():
  7.     info("Info","Your name is " + txt_name.value + " and you like " + txt_name2.value + ".")
  8.  
  9. def btn_go2_clicked():
  10.     info("Nice Try","Well done!!")
  11.  
  12. # Your GUI widgets go here
  13. lbl_name = Text(app, text="Hello. What's your name?")
  14. txt_name = TextBox(app)
  15. lbl_name2 = Text(app, text="What's an animal do you like?")
  16. txt_name2 = TextBox(app)
  17.  
  18. btn_go = PushButton(app, command=btn_go_clicked, text="Done")
  19.  
  20. btn_go2 = PushButton(app, command=btn_go2_clicked, text="New Message")
  21.  
  22. # Show the GUI on the screen
  23. app.display()
Add Comment
Please, Sign In to add comment