-
Notifications
You must be signed in to change notification settings - Fork 0
/
Feedback.py
86 lines (56 loc) · 2.36 KB
/
Feedback.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
from tkinter import *
from tkinter import ttk
from tkinter import messagebox
root = Tk()
frame_header = ttk.Frame(root)
frame_header.pack()
logo = PhotoImage(file='logo.gif').subsample(2, 2)
logolabel = ttk.Label(frame_header, text='logo', image=logo)
logolabel.grid(row=0, column=0, rowspan=2)
headerlabel = ttk.Label(frame_header, text='CUSTOMER FEEDBACK \nPowered by: AK_Programs.com',
foreground='#5a6be3',
font=('Arial', 24))
headerlabel.grid(row=0, column=1)
messagelabel = ttk.Label(frame_header,
text='PLEASE SEND YOUR FEEDBACK',
foreground='#d273d8', font=('Arial', 10))
messagelabel.grid(row=1, column=1)
frame_content = ttk.Frame(root)
frame_content.pack()
myvar = StringVar()
var = StringVar()
namelabel = ttk.Label(frame_content, text='Name')
namelabel.grid(row=0, column=0, padx=5, sticky='sw')
entry_name = ttk.Entry(frame_content, width=18, font=('Arial', 14), textvariable=myvar)
entry_name.grid(row=1, column=0)
emaillabel = ttk.Label(frame_content, text='Email')
emaillabel.grid(row=0, column=1, sticky='sw')
entry_email = ttk.Entry(frame_content, width=18, font=('Arial', 14), textvariable=var)
entry_email.grid(row=1, column=1)
commentlabel = ttk.Label(frame_content, text='Comment', font=('Arial', 10))
commentlabel.grid(row=2, column=0, sticky='sw')
textcomment = Text(frame_content, width=55, height=10)
textcomment.grid(row=3, column=0, columnspan=2)
textcomment.config(wrap ='word')
def clear():
global entry_name
global entry_email
global textcomment
messagebox.showinfo(title='clear', message='Do you want to clear?')
entry_name.delete(0, END)
entry_email.delete(0, END)
textcomment.delete(1.0, END)
def submit():
global entry_name
global entry_email
global textcomment
print('Name:{}'.format(myvar.get()))
print('Email:{}'.format(var.get()))
print('Comment:{}'.format(textcomment.get(1.0, END)))
messagebox.showinfo(title='Submit', message='Thanks for your Feedback, Your Comments Submited')
entry_name.delete(0, END)
entry_email.delete(0, END)
textcomment.delete(1.0, END)
submitbutton = ttk.Button(frame_content, text='Submit',command=submit).grid(row=4, column=0, sticky='e')
clearbutton = ttk.Button(frame_content, text='Clear', command=clear).grid(row=4, column=1, sticky='w')
mainloop()