Advertisement
maroph

eventgui.py

Dec 6th, 2019
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.74 KB | None | 0 0
  1. from guizero import App, TextBox, PushButton, Text, info
  2. app = App()
  3.  
  4. def btn_go_clicked():
  5.     info("Greetings","Hello, " + txt_name.value + " - are you really " + txt_age.value + " years old?\n" +
  6.          "You seem to live in " + txt_location.value)
  7.  
  8. def btn_go_clicked_deny():
  9.     info("*****Deny*****", "I don't believe your name is " + txt_name.value)
  10.  
  11. lbl_name = Text(app, text="Hello. What's your name?")
  12. txt_name = TextBox(app)
  13.  
  14. lbl_age = Text(app, text="What's your age?")
  15. txt_age = TextBox(app)
  16.  
  17. lbl_location = Text(app, text="Where do you live?")
  18. txt_location = TextBox(app)
  19.  
  20. btn_go = PushButton(app, command=btn_go_clicked, text="Done")
  21. btn_go = PushButton(app, command=btn_go_clicked_deny, text="Deny")
  22.  
  23. app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement