-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
44 lines (32 loc) · 1.31 KB
/
main.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
import tkinter as tk
import ctypes
from retirement import retirement
from investment import investment
from global_variables import COLORS
class Calculator_Main(tk.Tk):
def __init__(self):
tk.Tk.__init__(self)
container = tk.Frame(self)
container.grid(sticky="news")
self.resizable(False, False)
self.option_add('*foreground', COLORS['TEXT_COLOR'])
self.frames = {}
for frame in (investment, retirement):
page_name = frame.__name__
frame = frame(master=container, controller=self)
self.frames[page_name] = frame
frame.grid(row=0, column=0, sticky="nsew")
self.show_frame("investment")
self.title("Investment Calculator")
def show_frame(self, frame_name):
'''Show a frame for the given page name'''
# frame = self.frames[frame_name]
self.frames[frame_name].tkraise()
"""changes color of buttons on hover"""
def on_hover(self, e):
e.widget.config(background="#F0F3FF", foreground= COLORS['TEXT_COLOR'])
def on_leave(self, e):
e.widget.config(background='SystemButtonFace', foreground= COLORS['TEXT_COLOR'])
if __name__ == "__main__":
app = Calculator_Main()
app.mainloop()