initial gui

This commit is contained in:
andrei-mihnea-cerbu
2024-01-13 00:21:19 +02:00
parent e56b3a5340
commit 2a9860ebfa
10 changed files with 175 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
import tkinter as tk
from app.views.login import LoginView
from app.views.initial import InitialView
from app.views.signup import SignupView
class MainApplication(tk.Tk):
def __init__(self):
super().__init__()
self.title("Messenger App")
screen_height = self.winfo_screenheight()
self.geometry(f"{screen_height // 2}x{screen_height // 2}")
# Create instances of the views
self.login_view = LoginView(self)
self.initial_view = InitialView(self)
self.signup_view = SignupView(self)
self.main_view = tk.Label(self, text="Main View")
self.current_view = None
self.change_view(self.initial_view)
def change_view(self, view: tk.Frame):
if self.current_view:
self.current_view.pack_forget()
self.current_view = view
self.current_view.pack(expand=True, fill=tk.BOTH)
self.current_view.place(relx=0.5, rely=0.5, anchor=tk.CENTER)