forked from tarunsinghofficial/HacktoberFest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Complaint Box
54 lines (45 loc) · 1.49 KB
/
Complaint Box
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
#!/usr/bin/python3
from tkinter import *
from tkinter.ttk import *
from tkinter.messagebox import *
from db import DBConnect
from listComp import ListComp
#Config
conn = DBConnect()
root = Tk()
root.geometry('600x400')
root.minsize(550,300)
root.title('Complaint Box By Yogesh Sharma')
root.configure(background='red')
#Style
style = Style()
style.theme_use('classic')
for elem in ['TLabel', 'TButton', 'TRadioutton']:
style.configure(elem, background='powderblue')
#Gridx1353
labels = ['Full Name:', 'Gender:', 'Comment:']
for i in range(3):
Label(root, text=labels[i]).grid(row=i, column=0, padx=10, pady=10)
BuList = Button(root, text='List Comp.')
BuList.grid(row=4, column=1)
BuSubmit = Button(root, text='Submit Now')
BuSubmit.grid(row=4, column=2)
#Entries
fullname = Entry(root, width=40, font=('Arial', 14))
fullname.grid(row=0, column=1, columnspan=2)
SpanGender = StringVar()
Radiobutton(root, text='Male', value='male', variable=SpanGender).grid(row=1, column=1)
Radiobutton(root, text='Female', value='female', variable=SpanGender).grid(row=1, column=2)
comment = Text(root, width=35, height=5, font=('Arial', 14))
comment.grid(row=2, column=1, columnspan=2, padx=10, pady=10)
#projecto.in
def SaveData():
msg = conn.Add(fullname.get(), SpanGender.get(), comment.get(1.0, 'end'))
fullname.delete(0, 'end')
comment.delete(1.0, 'end')
showinfo(title='Add Info', message=msg)
def ShowList():
listrequest = ListComp()
BuSubmit.config(command=SaveData)
BuList.config(command=ShowList)
root.mainloop()