proiect finalizat

This commit is contained in:
andrei-mihnea-cerbu
2024-01-13 12:59:19 +02:00
parent 54542da299
commit 67b7a241d7
53 changed files with 321 additions and 19 deletions
+6
View File
@@ -6,6 +6,10 @@ from app.views.user_frame import UserFrame
class MainPageView(tk.Frame):
"""
This is the view from which the user will open a chat with anyone which is registered in the system. Each chat is
shown as a box with a photo, the username and the email.
"""
def __init__(self, master=None):
super().__init__(master)
self.form_frame = None
@@ -20,6 +24,7 @@ class MainPageView(tk.Frame):
self.body = None
def create_widgets(self):
"""Takes care of the creation of the UI"""
# Create a main frame to center the user frame and button frame
main_frame = tk.Frame(self.master)
main_frame.pack(expand=True)
@@ -57,6 +62,7 @@ class MainPageView(tk.Frame):
self.master.change_to_initial_view()
def open_chat(self, user_data):
"""Opens a chat in a different window"""
# Pass both the clicked user data and the current logged user info to ChatWindow
chat_window = ChatWindow(self, user_data, self.master.current_logged_user)
chat_window.mainloop() # Main loop for the new window