maroph icon

eventgui.py

maroph | PRO | 12/06/19 03:53:19 PM UTC | 0 ⭐ | 388 👁️ | Never ⏰ | []
Python |

740 B

|

None

|

0 👍

/

0 👎

from guizero import App, TextBox, PushButton, Text, info
app = App()
 
def btn_go_clicked():
    info("Greetings","Hello, " + txt_name.value + " - are you really " + txt_age.value + " years old?\n" +
         "You seem to live in " + txt_location.value)
 
def btn_go_clicked_deny():
    info("*****Deny*****", "I don't believe your name is " + txt_name.value)
 
lbl_name = Text(app, text="Hello. What's your name?")
txt_name = TextBox(app)
 
lbl_age = Text(app, text="What's your age?")
txt_age = TextBox(app)
 
lbl_location = Text(app, text="Where do you live?")
txt_location = TextBox(app)
 
btn_go = PushButton(app, command=btn_go_clicked, text="Done")
btn_go = PushButton(app, command=btn_go_clicked_deny, text="Deny")
 
app.display()

Comments