-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoverview.py
30 lines (26 loc) · 884 Bytes
/
overview.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
# overview.py
import tkinter as tk
from main_view import MainView
from register_view import RegisterView
class AppController(tk.Tk):
def __init__(self):
super().__init__()
self.title("Academia USAC")
self.attributes('-fullscreen', True)
self.current_view = None
self.view_classes = {
'MainView': MainView,
'RegisterView': RegisterView
}
self.switch_view('MainView')
def switch_view(self, view_name):
view_class = self.view_classes.get(view_name)
if view_class:
new_view = view_class(self, self.switch_view)
if self.current_view:
self.current_view.pack_forget()
self.current_view = new_view
self.current_view.pack(fill=tk.BOTH, expand=True)
if __name__ == "__main__":
app = AppController()
app.mainloop()