update main to use window_handler

master
BodgeMaster 2022-03-19 06:08:38 +01:00
parent 64fafe1d1e
commit 6a1386f15c
1 changed files with 5 additions and 17 deletions

22
main.py
View File

@ -3,6 +3,7 @@ import os
import tkinter as tk
from tkinter import ttk
import gui_helper
import gui_handler
from config import Config
################################################################################
@ -24,21 +25,8 @@ configuration = Config(configuration_file_path, default_configuration)
# PROGRAM MAIN WINDOW
################################################################################
main_window = tk.Tk()
main_window.title("IDE")
main_window.geometry(configuration.get_configuration_value("window geometry"))
main_window = gui_handler.window()
main_window.set_title("Concorde IDE")
main_window.set_geometry(configuration.get_configuration_value("window geometry"))
menubar = None
def rebuild_menu(structure_dict):
menubar = tk.Menu(main_window)
gui_helper.build_menu(structure_dict, menubar)
main_window.config(menu=menubar)
rebuild_menu(gui_helper.menu_structure)
def handle_exit():
configuration.set_configuration_value("window geometry", main_window.geometry())
main_window.destroy()
main_window.protocol("WM_DELETE_WINDOW", handle_exit)
main_window.mainloop()
main_window.update_menus(gui_helper.menu_structure)