-
Notifications
You must be signed in to change notification settings - Fork 0
/
texttest.py
59 lines (43 loc) · 1.37 KB
/
texttest.py
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import tkinter as tk
from tkinter import ttk
from tkinter.messagebox import showinfo
# root window
root = tk.Tk()
root.geometry("300x250")
root.resizable(False, False)
root.title('Sign In')
# store email address and password
email = tk.StringVar()
password = tk.StringVar()
def login_clicked():
""" callback when the login button clicked
"""
msg = f'You entered email: {email.get()} and password: {password.get()}, ' \
f'text={text.get()}'
showinfo(
title='Information',
message=msg
)
# Sign in frame
signin = ttk.Frame(root)
signin.pack(padx=10, pady=10, fill='x', expand=True)
# email
email_label = ttk.Label(signin, text="Email Address:")
email_label.pack(fill='x', expand=True)
email_entry = ttk.Entry(signin, textvariable=email)
email_entry.pack(fill='x', expand=True)
email_entry.focus()
text = tk.StringVar()
# self.text.set('')
textbox = tk.Entry(signin, textvariable=text, width=25, bg='white')
# textbox.bind('<KeyPress>', self.keypress_in_entry)
textbox.pack()
# password
password_label = ttk.Label(signin, text="Password:")
password_label.pack(fill='x', expand=True)
password_entry = ttk.Entry(signin, textvariable=password, show="*")
password_entry.pack(fill='x', expand=True)
# login button
login_button = ttk.Button(signin, text="Login", command=login_clicked)
login_button.pack(fill='x', expand=True, pady=10)
root.mainloop()