File: textbox.py

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

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

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

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()