|
|
|
import tkinter
|
|
|
|
import customtkinter
|
|
|
|
from frames import SidebarFrame, PersonFrame, VermögenFrame
|
|
|
|
|
|
|
|
# Main application
|
|
|
|
class App(customtkinter.CTk):
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
super().__init__()
|
|
|
|
|
|
|
|
#container to pack different windows of the app into
|
|
|
|
container = customtkinter.CTkFrame(self)
|
|
|
|
container.pack(expand=True, fill='both')
|
|
|
|
container.grid_rowconfigure(0, weight=1)
|
|
|
|
container.grid_columnconfigure(0, weight=1)
|
|
|
|
self.sidebar = SidebarFrame(container, self)
|
|
|
|
self.sidebar.grid(row=0, column=0, padx=20, pady=20)
|
|
|
|
|
|
|
|
self.frames = {}
|
|
|
|
self.frames['personFrame'] = PersonFrame(container, self)
|
|
|
|
self.frames['vermögenFrame'] = VermögenFrame(container, self)
|
|
|
|
|
|
|
|
for F in ('personFrame', 'vermögenFrame'):
|
|
|
|
|
|
|
|
self.frames[F].grid(row = 0, column = 1, sticky='nsew')
|
|
|
|
|
|
|
|
self.show_frame('personFrame')
|
|
|
|
|
|
|
|
def show_frame(self, page_class):
|
|
|
|
frame = self.frames[page_class]
|
|
|
|
frame.tkraise()
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
app = App()
|
|
|
|
app.mainloop()
|