-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEntry_widget.py
More file actions
38 lines (26 loc) · 868 Bytes
/
Entry_widget.py
File metadata and controls
38 lines (26 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from tkinter import *
# entry widget = textbox that accepts a single line of user input
def submit():
username = entry.get()
print("Hello " + username)
entry.config(state=DISABLED)
def delete():
entry.delete(0, END)
def Backspace():
entry.delete(len(entry.get()) - 1, END)
window = Tk()
entry = Entry(window,
font=("Time new Roman", 50),
fg="#00FF00",
bg="black", )
# entry.insert(0, 'Enter your username')
# entry.config(show="*")
# entry.config(state=DISABLED)
entry.pack(side=LEFT)
submit_button = Button(window, text="Submit", command=submit)
submit_button.pack(side=RIGHT)
delete_button = Button(window, text="Delete", command=delete)
delete_button.pack(side=RIGHT)
backspace_button = Button(window, text="BackSpace", command=Backspace)
backspace_button.pack(side=RIGHT)
window.mainloop()