pygui: added option to launch core-pygui into a specific session using an id
This commit is contained in:
parent
165e404184
commit
e34002b851
5 changed files with 34 additions and 26 deletions
|
@ -1,9 +1,10 @@
|
|||
import tkinter as tk
|
||||
from tkinter import ttk
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from core.gui.dialogs.dialog import Dialog
|
||||
from core.gui.images import ImageEnum, Images
|
||||
from core.gui.themes import FRAME_PAD, PADX, PADY
|
||||
from core.gui.themes import PADY
|
||||
from core.gui.widgets import CodeText
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
@ -21,21 +22,15 @@ class ErrorDialog(Dialog):
|
|||
def draw(self) -> None:
|
||||
self.top.columnconfigure(0, weight=1)
|
||||
self.top.rowconfigure(1, weight=1)
|
||||
|
||||
frame = ttk.Frame(self.top, padding=FRAME_PAD)
|
||||
frame.grid(pady=PADY, sticky="ew")
|
||||
frame.columnconfigure(1, weight=1)
|
||||
image = Images.get(ImageEnum.ERROR, 36)
|
||||
label = ttk.Label(frame, image=image)
|
||||
image = Images.get(ImageEnum.ERROR, 24)
|
||||
label = ttk.Label(
|
||||
self.top, text=self.title, image=image, compound=tk.LEFT, anchor=tk.CENTER
|
||||
)
|
||||
label.image = image
|
||||
label.grid(row=0, column=0, padx=PADX)
|
||||
label = ttk.Label(frame, text=self.title)
|
||||
label.grid(row=0, column=1, sticky="ew")
|
||||
|
||||
label.grid(sticky=tk.EW, pady=PADY)
|
||||
self.error_message = CodeText(self.top)
|
||||
self.error_message.text.insert("1.0", self.details)
|
||||
self.error_message.text.config(state="disabled")
|
||||
self.error_message.grid(sticky="nsew", pady=PADY)
|
||||
|
||||
self.error_message.text.config(state=tk.DISABLED)
|
||||
self.error_message.grid(sticky=tk.NSEW, pady=PADY)
|
||||
button = ttk.Button(self.top, text="Close", command=lambda: self.destroy())
|
||||
button.grid(sticky="ew")
|
||||
button.grid(sticky=tk.EW)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue