forked from shah-deep/Online-Voting-System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
homePage.py
53 lines (39 loc) · 1.76 KB
/
homePage.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
import subprocess as sb_p
import tkinter as tk
from tkinter import *
from Admin import AdmLogin
from voter import voterLogin
def Home(root, frame1, frame2):
for frame in root.winfo_children():
for widget in frame.winfo_children():
widget.destroy()
Button(frame2, text="Home", command = lambda: Home(root, frame1, frame2)).grid(row=0,column=0)
Label(frame2, text=" ").grid(row = 0,column = 1)
Label(frame2, text=" ").grid(row = 0,column = 2)
Label(frame2, text=" ").grid(row = 1,column = 1)
frame2.pack(side=TOP)
root.title("Home")
Label(frame1, text="Home", font=('Helvetica', 25, 'bold')).grid(row = 0, column = 1, rowspan=1)
Label(frame1, text="").grid(row = 1,column = 0)
#Admin Login
admin = Button(frame1, text="Admin Login", width=15, command = lambda: AdmLogin(root, frame1))
#Voter Login
voter = Button(frame1, text="Voter Login", width=15, command = lambda: voterLogin(root, frame1))
#New Tab
newTab = Button(frame1, text="New Window", width=15, command = lambda: sb_p.call('start python homePage.py', shell=True))
Label(frame1, text="").grid(row = 2,column = 0)
Label(frame1, text="").grid(row = 4,column = 0)
Label(frame1, text="").grid(row = 6,column = 0)
admin.grid(row = 3, column = 1, columnspan = 2)
voter.grid(row = 5, column = 1, columnspan = 2)
newTab.grid(row = 7, column = 1, columnspan = 2)
frame1.pack()
root.mainloop()
def new_home():
root = Tk()
root.geometry('500x500')
frame1 = Frame(root)
frame2 = Frame(root)
Home(root, frame1, frame2)
if __name__ == "__main__":
new_home()