32 lines
1.2 KiB
Python
32 lines
1.2 KiB
Python
import tkinter as tk
|
|
from .gui.main_window import MainWindow
|
|
from .controller.app_controller import AppController
|
|
|
|
def main():
|
|
"""
|
|
Main function to launch the Flight Monitor application.
|
|
Initializes the Tkinter root, the application controller, and the main window.
|
|
"""
|
|
# Initialize the Tkinter root window
|
|
root = tk.Tk()
|
|
|
|
# Create the application controller
|
|
# The controller might need a reference to the window,
|
|
# and the window will need a reference to the controller.
|
|
# We can pass the controller to the window, and then set the window in the controller.
|
|
app_controller = AppController()
|
|
|
|
# Create the main application window
|
|
# Pass the root and the controller to the MainWindow
|
|
main_app_window = MainWindow(root, app_controller)
|
|
|
|
# Set the main window instance in the controller if it needs to call methods on the window
|
|
app_controller.set_main_window(main_app_window)
|
|
|
|
# Start the Tkinter event loop
|
|
root.mainloop()
|
|
|
|
if __name__ == "__main__":
|
|
# This ensures that main() is called only when the script is executed directly
|
|
# (e.g., python -m FlightMonitor) and not when imported as a module.
|
|
main() |