import customtkinter 
from views.mainScreen import MainFrame
from controller.mainFrameController import MainFrameController
import os
from PIL import ImageTk


class Main(customtkinter.CTk):
    
    def __init__(self) -> None:
        super().__init__()
        # Grid-Konfiguration, um das Frame an die Größe anzupassen
        self.grid_rowconfigure(0, weight=1)
        self.grid_columnconfigure(0, weight=1)
        
        self.iconpath = ImageTk.PhotoImage(file=os.path.join("src/ui","logo.png"))
        self.wm_iconbitmap()
        self.iconphoto(False, self.iconpath)
        
        main_frame = MainFrame(self)
        main_frame.grid(row=0, column=0, padx=10, pady=10,sticky="nsew")
        controller_mainframe = MainFrameController(main_frame)
        main_frame.set_controller(controller_mainframe)
        
        self.title("Veracity_AI")
        self.geometry("800x500")
        

if __name__ == "__main__":
    customtkinter.set_default_color_theme('theme/theme.json')
    customtkinter.set_appearance_mode("dark")
    app = Main()
    app.mainloop()