import tkinter as tk
from design import CalculatorUI
from logic import CalculatorLogic
from controller import CalculatorController


def main():
    root = tk.Tk()

    # Create the logic handler
    logic = CalculatorLogic()

    # Create the controller and pass the logic handler
    controller = CalculatorController(logic)

    # Create the view and handle the controller
    app = CalculatorUI(root, controller)

    # Give the view to the controller
    controller.set_ui(app)

    root.mainloop()


if __name__ == "__main__":
    main()