update main to use window_handler
parent
64fafe1d1e
commit
6a1386f15c
22
main.py
22
main.py
|
@ -3,6 +3,7 @@ import os
|
||||||
import tkinter as tk
|
import tkinter as tk
|
||||||
from tkinter import ttk
|
from tkinter import ttk
|
||||||
import gui_helper
|
import gui_helper
|
||||||
|
import gui_handler
|
||||||
from config import Config
|
from config import Config
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
@ -24,21 +25,8 @@ configuration = Config(configuration_file_path, default_configuration)
|
||||||
# PROGRAM MAIN WINDOW
|
# PROGRAM MAIN WINDOW
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
main_window = tk.Tk()
|
main_window = gui_handler.window()
|
||||||
main_window.title("IDE")
|
main_window.set_title("Concorde IDE")
|
||||||
main_window.geometry(configuration.get_configuration_value("window geometry"))
|
main_window.set_geometry(configuration.get_configuration_value("window geometry"))
|
||||||
|
|
||||||
menubar = None
|
main_window.update_menus(gui_helper.menu_structure)
|
||||||
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()
|
|
||||||
|
|
Reference in New Issue