added qt stuff
parent
4e193da02f
commit
340a1ef389
|
@ -1,3 +1,4 @@
|
|||
*.swp
|
||||
__pycache__
|
||||
.spyproject
|
||||
concordenv
|
|
@ -1,2 +1,8 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from PySide6 import QtCore, QtWidgets
|
||||
|
||||
class MainWindow(QtWidgets.QWidget):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.text = QtWidgets.QLabel("Hello World", alignment=QtCore.Qt.AlignCenter)
|
||||
self.layout = QtWidgets.QVBoxLayout(self)
|
||||
self.layout.addWidget(self.text)
|
||||
|
|
31
main.py
31
main.py
|
@ -1,8 +1,9 @@
|
|||
#!/usr/bin/python3
|
||||
import os
|
||||
import tkinter as tk
|
||||
from tkinter import ttk
|
||||
import sys
|
||||
import gui_helper
|
||||
import gui_handler
|
||||
from PySide6 import QtWidgets
|
||||
from config import Config
|
||||
|
||||
################################################################################
|
||||
|
@ -10,9 +11,9 @@ from config import Config
|
|||
################################################################################
|
||||
|
||||
default_configuration = {
|
||||
"window geometry": "640x480"
|
||||
"window geometry": (800, 600)
|
||||
}
|
||||
configuration_file_path = os.path.join(os.path.expanduser("~"), "some_ide_config.json")
|
||||
configuration_file_path = os.path.join(os.path.expanduser("~"), "concorde_ide_config.json")
|
||||
|
||||
################################################################################
|
||||
# PROGRAM STARTUP
|
||||
|
@ -24,21 +25,9 @@ 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"))
|
||||
app = QtWidgets.QApplication([])
|
||||
main_window = gui_handler.MainWindow()
|
||||
main_window.resize(800, 600)
|
||||
main_window.show()
|
||||
|
||||
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()
|
||||
sys.exit(app.exec())
|
Reference in New Issue