-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHomePage.py
51 lines (38 loc) · 2.11 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
from tkinter import *
from tkinter import ttk
import Login_Student
import Login_Employee
class Main_Page:
def __init__(self, root, ls):
self.root = root
self.ls = ls
# Creating the first frame.
self.frame = Frame(root, bg='#163148')
self.frame.place(x=0, y=0, width=ls[0], height=ls[1])
# Creating the first frame.
self.frame1 = Frame(self.frame, bg='#ffffff')
self.frame1.place(x=ls[0]//9*2, y=ls[1]//4, width=ls[0]//9*5, height=ls[1]//4*2)
# Taking All pics in the variable.
self.photo_student = PhotoImage(file=r"Images/student_img.png")
self.photo_employee = PhotoImage(file=r"Images/employee.png")
# Resizing the Images as per requirement.
self.photo_student = self.photo_student.subsample(4, 4)
self.photo_employee = self.photo_employee.subsample(4, 4)
# Labeling the page.
self.title = Label(self.frame, text='IIT BBS', font=('Algerian', 25, 'bold'), bg='LightGreen').pack(
side=TOP)
# Title for Register/Login.
self.title1 = Label(self.frame1, text='Register/Login', font=('Algerian', 25, 'bold'), bg='#ffffff').pack(side=TOP)
# Creating two buttons.
self.student_btn = Button(self.frame1, text='Student', bd=0, bg='#ffffff', image=self.photo_student,
compound=TOP, command=self.student) \
.place(width=ls[0] // 9, height=ls[1] // 3, x=(ls[0]//9)*3-ls[0]//9*2, y=(ls[1] // 3)-ls[1]//4)
self.employee_btn = Button(self.frame1, text="Faculty", bd=0, bg='#ffffff', image=self.photo_employee,
compound=TOP, command=self.employee) \
.place(width=ls[0] // 9, height=ls[1] // 3, x=(ls[0]//9 * 5)-ls[0]//9*2, y=(ls[1] // 3)-ls[1]//4)
def student(self):
self.frame.place_forget()
student_menu = Login_Student.Student_Show(self.root, self.ls, self.frame)
def employee(self):
self.frame.place_forget()
employee_menu = Login_Employee.Employee_Show(self.root, self.ls, self.frame)