gui: updated core.gui to not use deprecated type hinting

This commit is contained in:
Blake Harnden 2023-04-13 15:53:16 -07:00
parent 69f05a6712
commit e7351b594d
40 changed files with 268 additions and 257 deletions

View file

@ -1,6 +1,6 @@
import tkinter as tk
from tkinter import ttk
from typing import TYPE_CHECKING, Optional, Tuple
from typing import TYPE_CHECKING, Optional
from core.gui.themes import Styles
@ -27,7 +27,7 @@ class CanvasTooltip:
self,
canvas: "CanvasGraph",
*,
pad: Tuple[int, int, int, int] = (5, 3, 5, 3),
pad: tuple[int, int, int, int] = (5, 3, 5, 3),
waittime: int = 400,
wraplength: int = 600
) -> None:
@ -37,7 +37,7 @@ class CanvasTooltip:
self.wraplength: int = wraplength
self.canvas: "CanvasGraph" = canvas
self.text: tk.StringVar = tk.StringVar()
self.pad: Tuple[int, int, int, int] = pad
self.pad: tuple[int, int, int, int] = pad
self.id: Optional[str] = None
self.tw: Optional[tk.Toplevel] = None
@ -63,8 +63,8 @@ class CanvasTooltip:
canvas: "CanvasGraph",
label: ttk.Label,
*,
tip_delta: Tuple[int, int] = (10, 5),
pad: Tuple[int, int, int, int] = (5, 3, 5, 3)
tip_delta: tuple[int, int] = (10, 5),
pad: tuple[int, int, int, int] = (5, 3, 5, 3)
):
c = canvas
s_width, s_height = c.winfo_screenwidth(), c.winfo_screenheight()