forked from kaylawang05/SeniorHomeApp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tkHome.py
114 lines (93 loc) · 2.4 KB
/
tkHome.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
import tkinter as tk
from tkinter import *
from PIL import ImageTk
import logEmail
import tkSignIn
import tkSignOut
import tkUpdateProfile
bg_color = "#FAE5AC"
button_color = "#cd661d"
def openSignIn():
tkSignIn.run() # calls the tkSignIn.py python script
def openSignOut():
tkSignOut.run() # calls the tkSignOut.py python script
def openUpdateProfile():
tkUpdateProfile.run() # calls the tkUpdateProfile.py python script
def openLog():
logEmail.run() # calls the tkVisitorLog.py python script
# initialize app
root = tk.Tk()
root.title("Springfield Senior Center Homepage")
root.eval("tk::PlaceWindow . center")
# creating a frame widget
homeFrame = tk.Frame(
root,
highlightbackground="#cd661d",
highlightthickness=5,
width=1000,
height=1000,
bg=bg_color,
)
homeFrame.grid(row=0, column=0)
homeFrame.pack_propagate(False)
# label widget
title = tk.Label(
homeFrame,
text="Welcome to the Springfield Senior Center Page!",
bg=bg_color,
fg="#5F5F9E",
font=("TkMenuFont", 25, "bold"),
).pack(pady=1)
# button widgets
sInButton = tk.Button(
homeFrame,
text=" SIGN-IN ",
font=("TkHeadingFont", 28),
bg=button_color,
fg="white",
cursor="hand2",
activebackground="#FFFF7F",
activeforeground="black",
command=openSignIn,
).place(x=275, y=100)
sOutButton = tk.Button(
homeFrame,
text="SIGN-OUT",
font=("TkHeadingFont", 28),
bg=button_color,
fg="white",
cursor="hand2",
activebackground="#FFFF7F",
activeforeground="black",
command=openSignOut,
).place(x=500, y=100)
updtButton = tk.Button(
homeFrame,
text="UPDATE PROFILE",
font=("TkHeadingFont", 14),
bg=button_color,
fg="white",
cursor="hand2",
activebackground="#FFFF7F",
activeforeground="black",
command=openUpdateProfile,
).place(x=302, y=200)
logButton = tk.Button(
homeFrame,
text=" SEND LOG INFO ",
font=("TkHeadingFont", 14),
bg=button_color,
fg="white",
cursor="hand2",
activebackground="#FFFF7F",
activeforeground="black",
command=openLog,
).place(x=500, y=200)
# homeFrame widgets
# IMAGE DIMENSIONS NEED TO BE 930x432
logo_img = ImageTk.PhotoImage(file="./images/frontentrance.jpeg")
logo_widget = tk.Label(homeFrame, image=logo_img, bg=bg_color)
logo_widget.image = logo_img
logo_widget.pack(side="bottom", pady=100)
# run app // displays window until EXIT
root.mainloop()