|
4 | 4 | from db import DBConnect |
5 | 5 | from listComp import ListComp |
6 | 6 |
|
7 | | -#Config |
| 7 | +# Config |
8 | 8 | conn = DBConnect() |
9 | 9 | root = Tk() |
10 | 10 | root.geometry('600x285') |
11 | 11 | root.title('Complaint Management') |
12 | 12 | root.configure(background='#AEB6BF') |
13 | 13 |
|
14 | | -#Style |
| 14 | +# Style |
15 | 15 | style = Style() |
16 | 16 | style.theme_use('classic') |
17 | 17 | for elem in ['TLabel', 'TButton', 'TRadioutton']: |
18 | | - style.configure(elem, background='#AEB6BF') |
| 18 | + style.configure(elem, background='#AEB6BF') |
19 | 19 |
|
20 | | -#Gridx1353 |
| 20 | +# Gridx1353 |
21 | 21 | labels = ['Full Name:', 'Gender:', 'Comment:'] |
22 | 22 | for i in range(3): |
23 | | - Label(root, text=labels[i]).grid(row=i, column=0, padx=10, pady=10) |
| 23 | + Label(root, text=labels[i]).grid(row=i, column=0, padx=10, pady=10) |
24 | 24 |
|
25 | 25 | BuList = Button(root, text='List Comp.') |
26 | 26 | BuList.grid(row=4, column=1) |
27 | 27 | BuSubmit = Button(root, text='Submit Now') |
28 | 28 | BuSubmit.grid(row=4, column=2) |
29 | 29 |
|
30 | | -#Entries |
| 30 | +# Entries |
31 | 31 | fullname = Entry(root, width=40, font=('Arial', 14)) |
32 | 32 | fullname.grid(row=0, column=1, columnspan=2) |
33 | 33 | SpanGender = StringVar() |
34 | 34 |
|
35 | | -Radiobutton(root, text='Male', value='male', variable=SpanGender).grid(row=1, column=1) |
36 | | -Radiobutton(root, text='Female', value='female', variable=SpanGender).grid(row=1, column=2) |
| 35 | +Radiobutton(root, text='Male', value='male', |
| 36 | + variable=SpanGender).grid(row=1, column=1) |
| 37 | +Radiobutton(root, text='Female', value='female', |
| 38 | + variable=SpanGender).grid(row=1, column=2) |
37 | 39 |
|
38 | 40 | comment = Text(root, width=35, height=5, font=('Arial', 14)) |
39 | 41 | comment.grid(row=2, column=1, columnspan=2, padx=10, pady=10) |
40 | 42 |
|
41 | | -#brought to you by code-projects.org |
| 43 | +# brought to you by code-projects.org |
| 44 | + |
| 45 | + |
42 | 46 | def SaveData(): |
43 | | - msg = conn.Add(fullname.get(), SpanGender.get(), comment.get(1.0, 'end')) |
44 | | - fullname.delete(0, 'end') |
45 | | - comment.delete(1.0, 'end') |
46 | | - showinfo(title='Add Info', message=msg) |
| 47 | + msg = conn.Add(fullname.get(), SpanGender.get(), comment.get(1.0, 'end')) |
| 48 | + fullname.delete(0, 'end') |
| 49 | + comment.delete(1.0, 'end') |
| 50 | + showinfo(title='Add Info', message=msg) |
| 51 | + |
47 | 52 |
|
48 | 53 | def ShowList(): |
49 | | - listrequest = ListComp() |
| 54 | + listrequest = ListComp() |
| 55 | + |
50 | 56 |
|
51 | 57 | BuSubmit.config(command=SaveData) |
52 | 58 | BuList.config(command=ShowList) |
53 | 59 |
|
54 | 60 | root.mainloop() |
55 | | - |
|
0 commit comments