pygui: added type hinting to class variables for core.gui.dialogs
This commit is contained in:
parent
11be40bc90
commit
527d34e374
37 changed files with 664 additions and 613 deletions
|
@ -16,23 +16,23 @@ class Dialog(tk.Toplevel):
|
|||
title: str,
|
||||
modal: bool = True,
|
||||
master: tk.BaseWidget = None,
|
||||
):
|
||||
) -> None:
|
||||
if master is None:
|
||||
master = app
|
||||
super().__init__(master)
|
||||
self.withdraw()
|
||||
self.app = app
|
||||
self.modal = modal
|
||||
self.app: "Application" = app
|
||||
self.modal: bool = modal
|
||||
self.title(title)
|
||||
self.protocol("WM_DELETE_WINDOW", self.destroy)
|
||||
image = Images.get(ImageEnum.CORE, 16)
|
||||
self.tk.call("wm", "iconphoto", self._w, image)
|
||||
self.columnconfigure(0, weight=1)
|
||||
self.rowconfigure(0, weight=1)
|
||||
self.top = ttk.Frame(self, padding=DIALOG_PAD)
|
||||
self.top: ttk.Frame = ttk.Frame(self, padding=DIALOG_PAD)
|
||||
self.top.grid(sticky="nsew")
|
||||
|
||||
def show(self):
|
||||
def show(self) -> None:
|
||||
self.transient(self.master)
|
||||
self.focus_force()
|
||||
self.update()
|
||||
|
@ -42,7 +42,7 @@ class Dialog(tk.Toplevel):
|
|||
self.grab_set()
|
||||
self.wait_window()
|
||||
|
||||
def draw_spacer(self, row: int = None):
|
||||
def draw_spacer(self, row: int = None) -> None:
|
||||
frame = ttk.Frame(self.top)
|
||||
frame.grid(row=row, sticky="nsew")
|
||||
frame.rowconfigure(0, weight=1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue