File: textbox.py

package info (click to toggle)
python-guizero 0.6.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,820 kB
  • sloc: python: 5,376; makefile: 28; sh: 17
file content (15 lines) | stat: -rw-r--r-- 393 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from guizero import App, TextBox, PushButton, Text, alerts
from tkinter.font import Font

def go():
    alerts.info("hi", "hi " + textbox.value)

def key_pressed(key):
    print("key pressed {}".format(key))

app = App()
text = Text(app, text="Enter your name")
textbox = TextBox(app, width=40)
textbox.update_command(key_pressed)
button = PushButton(app, text="Hi", command=go)
app.display()