login si signin done
This commit is contained in:
@@ -12,21 +12,26 @@ class MainApplication(tk.Tk):
|
||||
|
||||
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)
|
||||
|
||||
self.change_to_initial_view()
|
||||
|
||||
def change_to_initial_view(self):
|
||||
self.change_view(InitialView(self))
|
||||
|
||||
def change_to_sing_in_view(self):
|
||||
self.change_view(SignupView(self))
|
||||
|
||||
def change_to_login_view(self):
|
||||
self.change_view(LoginView(self))
|
||||
|
||||
def change_view(self, view: tk.Frame):
|
||||
if self.current_view:
|
||||
self.current_view.pack_forget()
|
||||
self.current_view.destroy()
|
||||
|
||||
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)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user