Big diff: use lower-case list and dict (#5888)

This commit is contained in:
Akuli
2021-08-08 19:26:35 +03:00
committed by GitHub
parent 11f54c3407
commit ce11072dbe
325 changed files with 2196 additions and 2334 deletions

View File

@@ -5,22 +5,7 @@ from enum import Enum
from tkinter.constants import * # comment this out to find undefined identifier names with flake8
from tkinter.font import _FontDescription
from types import TracebackType
from typing import (
Any,
Callable,
Dict,
Generic,
List,
Mapping,
Optional,
Protocol,
Sequence,
Tuple,
Type,
TypeVar,
Union,
overload,
)
from typing import Any, Callable, Generic, List, Mapping, Optional, Protocol, Sequence, Tuple, Type, TypeVar, Union, overload
from typing_extensions import Literal, TypedDict
# Using anything from tkinter.font in this file means that 'import tkinter'
@@ -200,7 +185,7 @@ class Variable:
def get(self) -> Any: ...
def trace_add(self, mode: _TraceMode, callback: Callable[[str, str, str], Any]) -> str: ...
def trace_remove(self, mode: _TraceMode, cbname: str) -> None: ...
def trace_info(self) -> List[Tuple[Tuple[_TraceMode, ...], str]]: ...
def trace_info(self) -> list[Tuple[Tuple[_TraceMode, ...], str]]: ...
def trace_variable(self, mode, callback): ... # deprecated
def trace_vdelete(self, mode, cbname): ... # deprecated
def trace_vinfo(self): ... # deprecated
@@ -240,7 +225,7 @@ def getboolean(s): ...
class Misc:
master: Misc | None
tk: _tkinter.TkappType
children: Dict[str, Widget]
children: dict[str, Widget]
def destroy(self) -> None: ...
def deletecommand(self, name: str) -> None: ...
def tk_strictMotif(self, boolean: Any | None = ...): ...
@@ -296,7 +281,7 @@ class Misc:
def winfo_atom(self, name: str, displayof: Literal[0] | Misc | None = ...): ...
def winfo_atomname(self, id: int, displayof: Literal[0] | Misc | None = ...): ...
def winfo_cells(self) -> int: ...
def winfo_children(self) -> List[Widget]: ... # Widget because it can't be Toplevel or Tk
def winfo_children(self) -> list[Widget]: ... # Widget because it can't be Toplevel or Tk
def winfo_class(self) -> str: ...
def winfo_colormapfull(self) -> bool: ...
def winfo_containing(self, rootX: int, rootY: int, displayof: Literal[0] | Misc | None = ...) -> Misc | None: ...
@@ -334,7 +319,7 @@ class Misc:
def winfo_viewable(self) -> bool: ...
def winfo_visual(self) -> str: ...
def winfo_visualid(self) -> str: ...
def winfo_visualsavailable(self, includeids: int = ...) -> List[Tuple[str, int]]: ...
def winfo_visualsavailable(self, includeids: int = ...) -> list[Tuple[str, int]]: ...
def winfo_vrootheight(self) -> int: ...
def winfo_vrootwidth(self) -> int: ...
def winfo_vrootx(self) -> int: ...
@@ -382,7 +367,7 @@ class Misc:
def register(
self, func: Callable[..., Any], subst: Callable[..., Sequence[Any]] | None = ..., needcleanup: int = ...
) -> str: ...
def keys(self) -> List[str]: ...
def keys(self) -> list[str]: ...
@overload
def pack_propagate(self, flag: bool) -> bool | None: ...
@overload
@@ -411,9 +396,9 @@ class Misc:
def grid_size(self) -> Tuple[int, int]: ...
size = grid_size
# Widget because Toplevel or Tk is never a slave
def pack_slaves(self) -> List[Widget]: ...
def grid_slaves(self, row: int | None = ..., column: int | None = ...) -> List[Widget]: ...
def place_slaves(self) -> List[Widget]: ...
def pack_slaves(self) -> list[Widget]: ...
def grid_slaves(self, row: int | None = ..., column: int | None = ...) -> list[Widget]: ...
def place_slaves(self) -> list[Widget]: ...
slaves = pack_slaves
def event_add(self, virtual: str, *sequences: str) -> None: ...
def event_delete(self, virtual: str, *sequences: str) -> None: ...
@@ -494,7 +479,7 @@ class Wm:
def wm_client(self, name: str | None = ...) -> str: ...
client = wm_client
@overload
def wm_colormapwindows(self) -> List[Misc]: ...
def wm_colormapwindows(self) -> list[Misc]: ...
@overload
def wm_colormapwindows(self, __wlist: _TkinterSequence[Misc]) -> None: ...
@overload
@@ -604,7 +589,7 @@ class Tk(Misc, Wm):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
background: _Color = ...,
bd: _ScreenUnits = ...,
@@ -622,7 +607,7 @@ class Tk(Misc, Wm):
relief: _Relief = ...,
takefocus: _TakeFocusValue = ...,
width: _ScreenUnits = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -841,7 +826,7 @@ class Toplevel(BaseWidget, Wm):
def __init__(
self,
master: Misc | None = ...,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
background: _Color = ...,
bd: _ScreenUnits = ...,
@@ -870,7 +855,7 @@ class Toplevel(BaseWidget, Wm):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
background: _Color = ...,
bd: _ScreenUnits = ...,
@@ -888,7 +873,7 @@ class Toplevel(BaseWidget, Wm):
relief: _Relief = ...,
takefocus: _TakeFocusValue = ...,
width: _ScreenUnits = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -897,7 +882,7 @@ class Button(Widget):
def __init__(
self,
master: Misc | None = ...,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
activebackground: _Color = ...,
activeforeground: _Color = ...,
@@ -945,7 +930,7 @@ class Button(Widget):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
activebackground: _Color = ...,
activeforeground: _Color = ...,
@@ -983,7 +968,7 @@ class Button(Widget):
underline: int = ...,
width: _ScreenUnits = ...,
wraplength: _ScreenUnits = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -994,7 +979,7 @@ class Canvas(Widget, XView, YView):
def __init__(
self,
master: Misc | None = ...,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
background: _Color = ...,
bd: _ScreenUnits = ...,
@@ -1036,7 +1021,7 @@ class Canvas(Widget, XView, YView):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
background: _Color = ...,
bd: _ScreenUnits = ...,
@@ -1068,7 +1053,7 @@ class Canvas(Widget, XView, YView):
xscrollincrement: _ScreenUnits = ...,
yscrollcommand: _XYScrollCommand = ...,
yscrollincrement: _ScreenUnits = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -1485,7 +1470,7 @@ class Checkbutton(Widget):
def __init__(
self,
master: Misc | None = ...,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
activebackground: _Color = ...,
activeforeground: _Color = ...,
@@ -1518,8 +1503,8 @@ class Checkbutton(Widget):
#
# I think Checkbutton shouldn't be generic, because then specifying
# "any checkbutton regardless of what variable it uses" would be
# difficult, and we might run into issues just like how List[float]
# and List[int] are incompatible. Also, we would need a way to
# difficult, and we might run into issues just like how list[float]
# and list[int] are incompatible. Also, we would need a way to
# specify "Checkbutton not associated with any variable", which is
# done by setting variable to empty string (the default).
offvalue: Any = ...,
@@ -1544,7 +1529,7 @@ class Checkbutton(Widget):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
activebackground: _Color = ...,
activeforeground: _Color = ...,
@@ -1588,7 +1573,7 @@ class Checkbutton(Widget):
variable: Variable | Literal[""] = ...,
width: _ScreenUnits = ...,
wraplength: _ScreenUnits = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -1604,7 +1589,7 @@ class Entry(Widget, XView):
def __init__(
self,
master: Misc | None = ...,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
background: _Color = ...,
bd: _ScreenUnits = ...,
@@ -1648,7 +1633,7 @@ class Entry(Widget, XView):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
background: _Color = ...,
bd: _ScreenUnits = ...,
@@ -1687,7 +1672,7 @@ class Entry(Widget, XView):
vcmd: _EntryValidateCommand = ...,
width: int = ...,
xscrollcommand: _XYScrollCommand = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -1715,7 +1700,7 @@ class Frame(Widget):
def __init__(
self,
master: Misc | None = ...,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
background: _Color = ...,
bd: _ScreenUnits = ...,
@@ -1741,7 +1726,7 @@ class Frame(Widget):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
background: _Color = ...,
bd: _ScreenUnits = ...,
@@ -1758,7 +1743,7 @@ class Frame(Widget):
relief: _Relief = ...,
takefocus: _TakeFocusValue = ...,
width: _ScreenUnits = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -1767,7 +1752,7 @@ class Label(Widget):
def __init__(
self,
master: Misc | None = ...,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
activebackground: _Color = ...,
activeforeground: _Color = ...,
@@ -1805,7 +1790,7 @@ class Label(Widget):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
activebackground: _Color = ...,
activeforeground: _Color = ...,
@@ -1838,7 +1823,7 @@ class Label(Widget):
underline: int = ...,
width: _ScreenUnits = ...,
wraplength: _ScreenUnits = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -1847,7 +1832,7 @@ class Listbox(Widget, XView, YView):
def __init__(
self,
master: Misc | None = ...,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
activestyle: Literal["dotbox", "none", "underline"] = ...,
background: _Color = ...,
@@ -1897,7 +1882,7 @@ class Listbox(Widget, XView, YView):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
activestyle: Literal["dotbox", "none", "underline"] = ...,
background: _Color = ...,
@@ -1928,7 +1913,7 @@ class Listbox(Widget, XView, YView):
width: int = ...,
xscrollcommand: _XYScrollCommand = ...,
yscrollcommand: _XYScrollCommand = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -1962,7 +1947,7 @@ class Menu(Widget):
def __init__(
self,
master: Misc | None = ...,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
activebackground: _Color = ...,
activeborderwidth: _ScreenUnits = ...,
@@ -1993,7 +1978,7 @@ class Menu(Widget):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
activebackground: _Color = ...,
activeborderwidth: _ScreenUnits = ...,
@@ -2016,7 +2001,7 @@ class Menu(Widget):
tearoffcommand: Callable[[str, str], Any] | str = ...,
title: str = ...,
type: Literal["menubar", "tearoff", "normal"] = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -2026,7 +2011,7 @@ class Menu(Widget):
def insert(self, index, itemType, cnf=..., **kw): ... # docstring says "Internal function."
def add_cascade(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
accelerator: str = ...,
activebackground: _Color = ...,
@@ -2047,7 +2032,7 @@ class Menu(Widget):
) -> None: ...
def add_checkbutton(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
accelerator: str = ...,
activebackground: _Color = ...,
@@ -2073,7 +2058,7 @@ class Menu(Widget):
) -> None: ...
def add_command(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
accelerator: str = ...,
activebackground: _Color = ...,
@@ -2093,7 +2078,7 @@ class Menu(Widget):
) -> None: ...
def add_radiobutton(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
accelerator: str = ...,
activebackground: _Color = ...,
@@ -2116,11 +2101,11 @@ class Menu(Widget):
value: Any = ...,
variable: Variable = ...,
) -> None: ...
def add_separator(self, cnf: Dict[str, Any] | None = ..., *, background: _Color = ...) -> None: ...
def add_separator(self, cnf: dict[str, Any] | None = ..., *, background: _Color = ...) -> None: ...
def insert_cascade(
self,
index: _MenuIndex,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
accelerator: str = ...,
activebackground: _Color = ...,
@@ -2142,7 +2127,7 @@ class Menu(Widget):
def insert_checkbutton(
self,
index: _MenuIndex,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
accelerator: str = ...,
activebackground: _Color = ...,
@@ -2169,7 +2154,7 @@ class Menu(Widget):
def insert_command(
self,
index: _MenuIndex,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
accelerator: str = ...,
activebackground: _Color = ...,
@@ -2190,7 +2175,7 @@ class Menu(Widget):
def insert_radiobutton(
self,
index: _MenuIndex,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
accelerator: str = ...,
activebackground: _Color = ...,
@@ -2213,7 +2198,7 @@ class Menu(Widget):
value: Any = ...,
variable: Variable = ...,
) -> None: ...
def insert_separator(self, index: _MenuIndex, cnf: Dict[str, Any] | None = ..., *, background: _Color = ...) -> None: ...
def insert_separator(self, index: _MenuIndex, cnf: dict[str, Any] | None = ..., *, background: _Color = ...) -> None: ...
def delete(self, index1: _MenuIndex, index2: _MenuIndex | None = ...) -> None: ...
def entrycget(self, index: _MenuIndex, option: str) -> Any: ...
def entryconfigure(
@@ -2232,7 +2217,7 @@ class Menubutton(Widget):
def __init__(
self,
master: Misc | None = ...,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
activebackground: _Color = ...,
activeforeground: _Color = ...,
@@ -2273,7 +2258,7 @@ class Menubutton(Widget):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
activebackground: _Color = ...,
activeforeground: _Color = ...,
@@ -2309,7 +2294,7 @@ class Menubutton(Widget):
underline: int = ...,
width: _ScreenUnits = ...,
wraplength: _ScreenUnits = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -2318,7 +2303,7 @@ class Message(Widget):
def __init__(
self,
master: Misc | None = ...,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
anchor: _Anchor = ...,
aspect: int = ...,
@@ -2348,7 +2333,7 @@ class Message(Widget):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
anchor: _Anchor = ...,
aspect: int = ...,
@@ -2372,7 +2357,7 @@ class Message(Widget):
text: float | str = ...,
textvariable: Variable = ...,
width: _ScreenUnits = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -2381,7 +2366,7 @@ class Radiobutton(Widget):
def __init__(
self,
master: Misc | None = ...,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
activebackground: _Color = ...,
activeforeground: _Color = ...,
@@ -2429,7 +2414,7 @@ class Radiobutton(Widget):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
activebackground: _Color = ...,
activeforeground: _Color = ...,
@@ -2472,7 +2457,7 @@ class Radiobutton(Widget):
variable: Variable | Literal[""] = ...,
width: _ScreenUnits = ...,
wraplength: _ScreenUnits = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -2485,7 +2470,7 @@ class Scale(Widget):
def __init__(
self,
master: Misc | None = ...,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
activebackground: _Color = ...,
background: _Color = ...,
@@ -2527,7 +2512,7 @@ class Scale(Widget):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
activebackground: _Color = ...,
background: _Color = ...,
@@ -2563,7 +2548,7 @@ class Scale(Widget):
troughcolor: _Color = ...,
variable: IntVar | DoubleVar = ...,
width: _ScreenUnits = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -2576,7 +2561,7 @@ class Scrollbar(Widget):
def __init__(
self,
master: Misc | None = ...,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
activebackground: _Color = ...,
activerelief: _Relief = ...,
@@ -2608,7 +2593,7 @@ class Scrollbar(Widget):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
activebackground: _Color = ...,
activerelief: _Relief = ...,
@@ -2631,7 +2616,7 @@ class Scrollbar(Widget):
takefocus: _TakeFocusValue = ...,
troughcolor: _Color = ...,
width: _ScreenUnits = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -2648,7 +2633,7 @@ class Text(Widget, XView, YView):
def __init__(
self,
master: Misc | None = ...,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
autoseparators: bool = ...,
background: _Color = ...,
@@ -2704,7 +2689,7 @@ class Text(Widget, XView, YView):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
autoseparators: bool = ...,
background: _Color = ...,
@@ -2751,7 +2736,7 @@ class Text(Widget, XView, YView):
wrap: Literal["none", "char", "word"] = ...,
xscrollcommand: _XYScrollCommand = ...,
yscrollcommand: _XYScrollCommand = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -2777,7 +2762,7 @@ class Text(Widget, XView, YView):
tag: bool = ...,
text: bool = ...,
window: bool = ...,
) -> List[Tuple[str, str, str]]: ...
) -> list[Tuple[str, str, str]]: ...
@overload
def dump(
self,
@@ -2833,7 +2818,7 @@ class Text(Widget, XView, YView):
def mark_next(self, index: _TextIndex) -> str | None: ...
def mark_previous(self, index: _TextIndex) -> str | None: ...
# **kw of peer_create is same as the kwargs of Text.__init__
def peer_create(self, newPathName: str | Text, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def peer_create(self, newPathName: str | Text, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def peer_names(self) -> Tuple[_tkinter.Tcl_Obj, ...]: ...
def replace(self, index1: _TextIndex, index2: _TextIndex, chars: str, *args: str | _TkinterSequence[str]) -> None: ...
def scan_mark(self, x: int, y: int) -> None: ...
@@ -2867,7 +2852,7 @@ class Text(Widget, XView, YView):
def tag_configure(
self,
tagName: str,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
background: _Color = ...,
bgstipple: _Bitmap = ...,
@@ -2897,7 +2882,7 @@ class Text(Widget, XView, YView):
underline: bool = ...,
underlinefg: _Color = ...,
wrap: Literal["none", "char", "word"] = ..., # be careful with "none" vs None
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def tag_configure(self, tagName: str, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
tag_config = tag_configure
@@ -2961,7 +2946,7 @@ class PhotoImage(Image):
def __init__(
self,
name: str | None = ...,
cnf: Dict[str, Any] = ...,
cnf: dict[str, Any] = ...,
master: Misc | _tkinter.TkappType | None = ...,
*,
data: str | bytes = ..., # not same as data argument of put()
@@ -3001,7 +2986,7 @@ class BitmapImage(Image):
def __init__(
self,
name: Any | None = ...,
cnf: Dict[str, Any] = ...,
cnf: dict[str, Any] = ...,
master: Misc | _tkinter.TkappType | None = ...,
*,
background: _Color = ...,
@@ -3019,7 +3004,7 @@ class Spinbox(Widget, XView):
def __init__(
self,
master: Misc | None = ...,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
activebackground: _Color = ...,
background: _Color = ...,
@@ -3077,7 +3062,7 @@ class Spinbox(Widget, XView):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
activebackground: _Color = ...,
background: _Color = ...,
@@ -3129,7 +3114,7 @@ class Spinbox(Widget, XView):
width: int = ...,
wrap: bool = ...,
xscrollcommand: _XYScrollCommand = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -3159,7 +3144,7 @@ class LabelFrame(Widget):
def __init__(
self,
master: Misc | None = ...,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
background: _Color = ...,
bd: _ScreenUnits = ...,
@@ -3192,7 +3177,7 @@ class LabelFrame(Widget):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
background: _Color = ...,
bd: _ScreenUnits = ...,
@@ -3215,7 +3200,7 @@ class LabelFrame(Widget):
takefocus: _TakeFocusValue = ...,
text: float | str = ...,
width: _ScreenUnits = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -3224,7 +3209,7 @@ class PanedWindow(Widget):
def __init__(
self,
master: Misc | None = ...,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
background: _Color = ...,
bd: _ScreenUnits = ...,
@@ -3252,7 +3237,7 @@ class PanedWindow(Widget):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
background: _Color = ...,
bd: _ScreenUnits = ...,
@@ -3275,7 +3260,7 @@ class PanedWindow(Widget):
sashwidth: _ScreenUnits = ...,
showhandle: bool = ...,
width: _ScreenUnits = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure

View File

@@ -1,9 +1,9 @@
from _typeshed import StrOrBytesPath
from tkinter import Button, Entry, Frame, Listbox, Misc, Scrollbar, StringVar, Toplevel, _TkinterSequence, commondialog
from typing import IO, Any, ClassVar, Dict, Iterable, Tuple
from typing import IO, Any, ClassVar, Iterable, Tuple
from typing_extensions import Literal
dialogstates: Dict[Any, Tuple[Any, Any]]
dialogstates: dict[Any, Tuple[Any, Any]]
class FileDialog:
title: str = ...

View File

@@ -1,5 +1,5 @@
from tkinter import Event, Misc, Toplevel
from typing import Any, List
from typing import Any
class Dialog(Toplevel):
def __init__(self, parent: Misc | None, title: str | None = ...) -> None: ...
@@ -11,7 +11,7 @@ class SimpleDialog:
self,
master: Misc | None,
text: str = ...,
buttons: List[str] = ...,
buttons: list[str] = ...,
default: int | None = ...,
cancel: int | None = ...,
title: str | None = ...,

View File

@@ -1,5 +1,5 @@
import tkinter
from typing import Any, Dict, List, Tuple
from typing import Any, Tuple
from typing_extensions import Literal
WINDOW: Literal["window"]
@@ -37,7 +37,7 @@ TCL_ALL_EVENTS: Literal[0]
class tixCommand:
def tix_addbitmapdir(self, directory: str) -> None: ...
def tix_cget(self, option: str) -> Any: ...
def tix_configure(self, cnf: Dict[str, Any] | None = ..., **kw: Any) -> Any: ...
def tix_configure(self, cnf: dict[str, Any] | None = ..., **kw: Any) -> Any: ...
def tix_filedialog(self, dlgclass: str | None = ...) -> str: ...
def tix_getbitmap(self, name: str) -> str: ...
def tix_getimage(self, name: str) -> str: ...
@@ -52,16 +52,16 @@ class TixWidget(tkinter.Widget):
self,
master: tkinter.Misc | None = ...,
widgetName: str | None = ...,
static_options: List[str] | None = ...,
cnf: Dict[str, Any] = ...,
kw: Dict[str, Any] = ...,
static_options: list[str] | None = ...,
cnf: dict[str, Any] = ...,
kw: dict[str, Any] = ...,
) -> None: ...
def __getattr__(self, name: str) -> Any: ...
def set_silent(self, value: str) -> None: ...
def subwidget(self, name: str) -> tkinter.Widget: ...
def subwidgets_all(self) -> List[tkinter.Widget]: ...
def subwidgets_all(self) -> list[tkinter.Widget]: ...
def config_all(self, option: Any, value: Any) -> None: ...
def image_create(self, imgtype: str, cnf: Dict[str, Any] = ..., master: tkinter.Widget | None = ..., **kw: Any) -> None: ...
def image_create(self, imgtype: str, cnf: dict[str, Any] = ..., master: tkinter.Widget | None = ..., **kw: Any) -> None: ...
def image_delete(self, imgname: str) -> None: ...
class TixSubWidget(TixWidget):
@@ -70,102 +70,102 @@ class TixSubWidget(TixWidget):
) -> None: ...
class DisplayStyle:
def __init__(self, itemtype: str, cnf: Dict[str, Any] = ..., *, master: tkinter.Widget | None = ..., **kw: Any) -> None: ...
def __init__(self, itemtype: str, cnf: dict[str, Any] = ..., *, master: tkinter.Widget | None = ..., **kw: Any) -> None: ...
def __getitem__(self, key: str) -> Any: ...
def __setitem__(self, key: str, value: Any) -> None: ...
def delete(self) -> None: ...
def config(self, cnf: Dict[str, Any] = ..., **kw: Any) -> Any: ...
def config(self, cnf: dict[str, Any] = ..., **kw: Any) -> Any: ...
class Balloon(TixWidget):
def __init__(self, master: tkinter.Widget | None = ..., cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def bind_widget(self, widget: tkinter.Widget, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def bind_widget(self, widget: tkinter.Widget, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def unbind_widget(self, widget: tkinter.Widget) -> None: ...
class ButtonBox(TixWidget):
def __init__(self, master: tkinter.Widget | None = ..., cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def add(self, name: str, cnf: Dict[str, Any] = ..., **kw: Any) -> tkinter.Widget: ...
def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def add(self, name: str, cnf: dict[str, Any] = ..., **kw: Any) -> tkinter.Widget: ...
def invoke(self, name: str) -> None: ...
class ComboBox(TixWidget):
def __init__(self, master: tkinter.Widget | None = ..., cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def add_history(self, str: str) -> None: ...
def append_history(self, str: str) -> None: ...
def insert(self, index: int, str: str) -> None: ...
def pick(self, index: int) -> None: ...
class Control(TixWidget):
def __init__(self, master: tkinter.Widget | None = ..., cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def decrement(self) -> None: ...
def increment(self) -> None: ...
def invoke(self) -> None: ...
class LabelEntry(TixWidget):
def __init__(self, master: tkinter.Widget | None = ..., cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
class LabelFrame(TixWidget):
def __init__(self, master: tkinter.Widget | None = ..., cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
class Meter(TixWidget):
def __init__(self, master: tkinter.Widget | None = ..., cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
class OptionMenu(TixWidget):
def __init__(self, master: tkinter.Widget | None, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def add_command(self, name: str, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def add_separator(self, name: str, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def add_command(self, name: str, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def add_separator(self, name: str, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def delete(self, name: str) -> None: ...
def disable(self, name: str) -> None: ...
def enable(self, name: str) -> None: ...
class PopupMenu(TixWidget):
def __init__(self, master: tkinter.Widget | None, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def bind_widget(self, widget: tkinter.Widget) -> None: ...
def unbind_widget(self, widget: tkinter.Widget) -> None: ...
def post_widget(self, widget: tkinter.Widget, x: int, y: int) -> None: ...
class Select(TixWidget):
def __init__(self, master: tkinter.Widget | None, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def add(self, name: str, cnf: Dict[str, Any] = ..., **kw: Any) -> tkinter.Widget: ...
def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def add(self, name: str, cnf: dict[str, Any] = ..., **kw: Any) -> tkinter.Widget: ...
def invoke(self, name: str) -> None: ...
class StdButtonBox(TixWidget):
def __init__(self, master: tkinter.Widget | None = ..., cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def invoke(self, name: str) -> None: ...
class DirList(TixWidget):
def __init__(self, master: tkinter.Widget | None, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def chdir(self, dir: str) -> None: ...
class DirTree(TixWidget):
def __init__(self, master: tkinter.Widget | None, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def chdir(self, dir: str) -> None: ...
class DirSelectDialog(TixWidget):
def __init__(self, master: tkinter.Widget | None, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def popup(self) -> None: ...
def popdown(self) -> None: ...
class DirSelectBox(TixWidget):
def __init__(self, master: tkinter.Widget | None, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
class ExFileSelectBox(TixWidget):
def __init__(self, master: tkinter.Widget | None, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def filter(self) -> None: ...
def invoke(self) -> None: ...
class FileSelectBox(TixWidget):
def __init__(self, master: tkinter.Widget | None, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def apply_filter(self) -> None: ...
def invoke(self) -> None: ...
class FileEntry(TixWidget):
def __init__(self, master: tkinter.Widget | None, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def invoke(self) -> None: ...
def file_dialog(self) -> None: ...
class HList(TixWidget, tkinter.XView, tkinter.YView):
def __init__(self, master: tkinter.Widget | None = ..., cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def add(self, entry: str, cnf: Dict[str, Any] = ..., **kw: Any) -> tkinter.Widget: ...
def add_child(self, parent: str | None = ..., cnf: Dict[str, Any] = ..., **kw: Any) -> tkinter.Widget: ...
def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def add(self, entry: str, cnf: dict[str, Any] = ..., **kw: Any) -> tkinter.Widget: ...
def add_child(self, parent: str | None = ..., cnf: dict[str, Any] = ..., **kw: Any) -> tkinter.Widget: ...
def anchor_set(self, entry: str) -> None: ...
def anchor_clear(self) -> None: ...
# FIXME: Overload, certain combos return, others don't
@@ -178,16 +178,16 @@ class HList(TixWidget, tkinter.XView, tkinter.YView):
def dragsite_clear(self) -> None: ...
def dropsite_set(self, index: int) -> None: ...
def dropsite_clear(self) -> None: ...
def header_create(self, col: int, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def header_configure(self, col: int, cnf: Dict[str, Any] = ..., **kw: Any) -> Any | None: ...
def header_create(self, col: int, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def header_configure(self, col: int, cnf: dict[str, Any] = ..., **kw: Any) -> Any | None: ...
def header_cget(self, col: int, opt: Any) -> Any: ...
def header_exists(self, col: int) -> bool: ...
def header_exist(self, col: int) -> bool: ...
def header_delete(self, col: int) -> None: ...
def header_size(self, col: int) -> int: ...
def hide_entry(self, entry: str) -> None: ...
def indicator_create(self, entry: str, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def indicator_configure(self, entry: str, cnf: Dict[str, Any] = ..., **kw: Any) -> Any | None: ...
def indicator_create(self, entry: str, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def indicator_configure(self, entry: str, cnf: dict[str, Any] = ..., **kw: Any) -> Any | None: ...
def indicator_cget(self, entry: str, opt: Any) -> Any: ...
def indicator_exists(self, entry: str) -> bool: ...
def indicator_delete(self, entry: str) -> None: ...
@@ -205,21 +205,21 @@ class HList(TixWidget, tkinter.XView, tkinter.YView):
def info_prev(self, entry: str) -> str: ...
def info_selection(self) -> Tuple[str, ...]: ...
def item_cget(self, entry: str, col: int, opt: Any) -> Any: ...
def item_configure(self, entry: str, col: int, cnf: Dict[str, Any] = ..., **kw: Any) -> Any | None: ...
def item_create(self, entry: str, col: int, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def item_configure(self, entry: str, col: int, cnf: dict[str, Any] = ..., **kw: Any) -> Any | None: ...
def item_create(self, entry: str, col: int, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def item_exists(self, entry: str, col: int) -> bool: ...
def item_delete(self, entry: str, col: int) -> None: ...
def entrycget(self, entry: str, opt: Any) -> Any: ...
def entryconfigure(self, entry: str, cnf: Dict[str, Any] = ..., **kw: Any) -> Any | None: ...
def entryconfigure(self, entry: str, cnf: dict[str, Any] = ..., **kw: Any) -> Any | None: ...
def nearest(self, y: int) -> str: ...
def see(self, entry: str) -> None: ...
def selection_clear(self, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def selection_clear(self, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def selection_includes(self, entry: str) -> bool: ...
def selection_set(self, first: str, last: str | None = ...) -> None: ...
def show_entry(self, entry: str) -> None: ...
class CheckList(TixWidget):
def __init__(self, master: tkinter.Widget | None = ..., cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def autosetmode(self) -> None: ...
def close(self, entrypath: str) -> None: ...
def getmode(self, entrypath: str) -> str: ...
@@ -229,7 +229,7 @@ class CheckList(TixWidget):
def setstatus(self, entrypath: str, mode: str = ...) -> None: ...
class Tree(TixWidget):
def __init__(self, master: tkinter.Widget | None = ..., cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def autosetmode(self) -> None: ...
def close(self, entrypath: str) -> None: ...
def getmode(self, entrypath: str) -> str: ...
@@ -237,7 +237,7 @@ class Tree(TixWidget):
def setmode(self, entrypath: str, mode: str = ...) -> None: ...
class TList(TixWidget, tkinter.XView, tkinter.YView):
def __init__(self, master: tkinter.Widget | None = ..., cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def active_set(self, index: int) -> None: ...
def active_clear(self) -> None: ...
def anchor_set(self, index: int) -> None: ...
@@ -247,7 +247,7 @@ class TList(TixWidget, tkinter.XView, tkinter.YView):
def dragsite_clear(self) -> None: ...
def dropsite_set(self, index: int) -> None: ...
def dropsite_clear(self) -> None: ...
def insert(self, index: int, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def insert(self, index: int, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def info_active(self) -> int: ...
def info_anchor(self) -> int: ...
def info_down(self, index: int) -> int: ...
@@ -258,44 +258,44 @@ class TList(TixWidget, tkinter.XView, tkinter.YView):
def info_up(self, index: int) -> int: ...
def nearest(self, x: int, y: int) -> int: ...
def see(self, index: int) -> None: ...
def selection_clear(self, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def selection_clear(self, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def selection_includes(self, index: int) -> bool: ...
def selection_set(self, first: int, last: int | None = ...) -> None: ...
class PanedWindow(TixWidget):
def __init__(self, master: tkinter.Widget | None, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def add(self, name: str, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def add(self, name: str, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def delete(self, name: str) -> None: ...
def forget(self, name: str) -> None: ... # type: ignore
def panecget(self, entry: str, opt: Any) -> Any: ...
def paneconfigure(self, entry: str, cnf: Dict[str, Any] = ..., **kw: Any) -> Any | None: ...
def panes(self) -> List[tkinter.Widget]: ...
def paneconfigure(self, entry: str, cnf: dict[str, Any] = ..., **kw: Any) -> Any | None: ...
def panes(self) -> list[tkinter.Widget]: ...
class ListNoteBook(TixWidget):
def __init__(self, master: tkinter.Widget | None, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def add(self, name: str, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def add(self, name: str, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def page(self, name: str) -> tkinter.Widget: ...
def pages(self) -> List[tkinter.Widget]: ...
def pages(self) -> list[tkinter.Widget]: ...
def raise_page(self, name: str) -> None: ...
class NoteBook(TixWidget):
def __init__(self, master: tkinter.Widget | None = ..., cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def add(self, name: str, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def add(self, name: str, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def delete(self, name: str) -> None: ...
def page(self, name: str) -> tkinter.Widget: ...
def pages(self) -> List[tkinter.Widget]: ...
def pages(self) -> list[tkinter.Widget]: ...
def raise_page(self, name: str) -> None: ...
def raised(self) -> bool: ...
class InputOnly(TixWidget):
def __init__(self, master: tkinter.Widget | None = ..., cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
class Form:
def __setitem__(self, key: str, value: Any) -> None: ...
def config(self, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def form(self, cnf: Dict[str, Any] = ..., **kw: Any) -> None: ...
def config(self, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def form(self, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
def check(self) -> bool: ...
def forget(self) -> None: ...
def grid(self, xsize: int = ..., ysize: int = ...) -> Tuple[int, int] | None: ...
def info(self, option: str | None = ...) -> Any: ...
def slaves(self) -> List[tkinter.Widget]: ...
def slaves(self) -> list[tkinter.Widget]: ...

View File

@@ -2,7 +2,7 @@ import _tkinter
import sys
import tkinter
from tkinter.font import _FontDescription
from typing import Any, Callable, Dict, Tuple, Union, overload
from typing import Any, Callable, Tuple, Union, overload
from typing_extensions import Literal, TypedDict
def tclobjs_to_py(adict): ...
@@ -57,7 +57,7 @@ class Button(Widget):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
command: tkinter._ButtonCommand = ...,
compound: _TtkCompound = ...,
@@ -72,7 +72,7 @@ class Button(Widget):
textvariable: tkinter.Variable = ...,
underline: int = ...,
width: int | Literal[""] = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -107,7 +107,7 @@ class Checkbutton(Widget):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
command: tkinter._ButtonCommand = ...,
compound: _TtkCompound = ...,
@@ -124,7 +124,7 @@ class Checkbutton(Widget):
underline: int = ...,
variable: tkinter.Variable = ...,
width: int | Literal[""] = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -158,7 +158,7 @@ class Entry(Widget, tkinter.Entry):
@overload # type: ignore
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
background: tkinter._Color = ...,
cursor: tkinter._Cursor = ...,
@@ -176,14 +176,14 @@ class Entry(Widget, tkinter.Entry):
validatecommand: tkinter._EntryValidateCommand = ...,
width: int = ...,
xscrollcommand: tkinter._XYScrollCommand = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
# config must be copy/pasted, otherwise ttk.Entry().config is mypy error (don't know why)
@overload # type: ignore
def config(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
background: tkinter._Color = ...,
cursor: tkinter._Cursor = ...,
@@ -201,7 +201,7 @@ class Entry(Widget, tkinter.Entry):
validatecommand: tkinter._EntryValidateCommand = ...,
width: int = ...,
xscrollcommand: tkinter._XYScrollCommand = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def config(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
def bbox(self, index): ...
@@ -238,7 +238,7 @@ class Combobox(Entry):
@overload # type: ignore
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
background: tkinter._Color = ...,
cursor: tkinter._Cursor = ...,
@@ -259,14 +259,14 @@ class Combobox(Entry):
values: tkinter._TkinterSequence[str] = ...,
width: int = ...,
xscrollcommand: tkinter._XYScrollCommand = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
# config must be copy/pasted, otherwise ttk.Combobox().config is mypy error (don't know why)
@overload # type: ignore
def config(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
background: tkinter._Color = ...,
cursor: tkinter._Cursor = ...,
@@ -287,7 +287,7 @@ class Combobox(Entry):
values: tkinter._TkinterSequence[str] = ...,
width: int = ...,
xscrollcommand: tkinter._XYScrollCommand = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def config(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
def current(self, newindex: Any | None = ...): ...
@@ -313,7 +313,7 @@ class Frame(Widget):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
border: tkinter._ScreenUnits = ...,
borderwidth: tkinter._ScreenUnits = ...,
@@ -324,7 +324,7 @@ class Frame(Widget):
style: str = ...,
takefocus: tkinter._TakeFocusValue = ...,
width: tkinter._ScreenUnits = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -360,7 +360,7 @@ class Label(Widget):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
anchor: tkinter._Anchor = ...,
background: tkinter._Color = ...,
@@ -382,7 +382,7 @@ class Label(Widget):
underline: int = ...,
width: int | Literal[""] = ...,
wraplength: tkinter._ScreenUnits = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -411,7 +411,7 @@ class Labelframe(Widget):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
border: tkinter._ScreenUnits = ...,
borderwidth: tkinter._ScreenUnits = ...,
@@ -426,7 +426,7 @@ class Labelframe(Widget):
text: float | str = ...,
underline: int = ...,
width: tkinter._ScreenUnits = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -457,7 +457,7 @@ class Menubutton(Widget):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
compound: _TtkCompound = ...,
cursor: tkinter._Cursor = ...,
@@ -472,7 +472,7 @@ class Menubutton(Widget):
textvariable: tkinter.Variable = ...,
underline: int = ...,
width: int | Literal[""] = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -494,7 +494,7 @@ class Notebook(Widget):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
cursor: tkinter._Cursor = ...,
height: int = ...,
@@ -502,7 +502,7 @@ class Notebook(Widget):
style: str = ...,
takefocus: tkinter._TakeFocusValue = ...,
width: int = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -535,28 +535,28 @@ class Panedwindow(Widget, tkinter.PanedWindow):
@overload # type: ignore
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
cursor: tkinter._Cursor = ...,
height: int = ...,
style: str = ...,
takefocus: tkinter._TakeFocusValue = ...,
width: int = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
# config must be copy/pasted, otherwise ttk.Panedwindow().config is mypy error (don't know why)
@overload # type: ignore
def config(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
cursor: tkinter._Cursor = ...,
height: int = ...,
style: str = ...,
takefocus: tkinter._TakeFocusValue = ...,
width: int = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def config(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
forget: Any
@@ -587,7 +587,7 @@ class Progressbar(Widget):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
cursor: tkinter._Cursor = ...,
length: tkinter._ScreenUnits = ...,
@@ -599,7 +599,7 @@ class Progressbar(Widget):
takefocus: tkinter._TakeFocusValue = ...,
value: float = ...,
variable: tkinter.IntVar | tkinter.DoubleVar = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -632,7 +632,7 @@ class Radiobutton(Widget):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
command: tkinter._ButtonCommand = ...,
compound: _TtkCompound = ...,
@@ -648,7 +648,7 @@ class Radiobutton(Widget):
value: Any = ...,
variable: tkinter.Variable | Literal[""] = ...,
width: int | Literal[""] = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -676,7 +676,7 @@ class Scale(Widget, tkinter.Scale):
@overload # type: ignore
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
command: str | Callable[[str], Any] = ...,
cursor: tkinter._Cursor = ...,
@@ -689,14 +689,14 @@ class Scale(Widget, tkinter.Scale):
to: float = ...,
value: float = ...,
variable: tkinter.IntVar | tkinter.DoubleVar = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
# config must be copy/pasted, otherwise ttk.Scale().config is mypy error (don't know why)
@overload # type: ignore
def config(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
command: str | Callable[[str], Any] = ...,
cursor: tkinter._Cursor = ...,
@@ -709,7 +709,7 @@ class Scale(Widget, tkinter.Scale):
to: float = ...,
value: float = ...,
variable: tkinter.IntVar | tkinter.DoubleVar = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def config(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
def get(self, x: Any | None = ..., y: Any | None = ...): ...
@@ -730,28 +730,28 @@ class Scrollbar(Widget, tkinter.Scrollbar):
@overload # type: ignore
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
command: Callable[..., Tuple[float, float] | None] | str = ...,
cursor: tkinter._Cursor = ...,
orient: Literal["horizontal", "vertical"] = ...,
style: str = ...,
takefocus: tkinter._TakeFocusValue = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
# config must be copy/pasted, otherwise ttk.Scrollbar().config is mypy error (don't know why)
@overload # type: ignore
def config(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
command: Callable[..., Tuple[float, float] | None] | str = ...,
cursor: tkinter._Cursor = ...,
orient: Literal["horizontal", "vertical"] = ...,
style: str = ...,
takefocus: tkinter._TakeFocusValue = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def config(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
@@ -770,13 +770,13 @@ class Separator(Widget):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
cursor: tkinter._Cursor = ...,
orient: Literal["horizontal", "vertical"] = ...,
style: str = ...,
takefocus: tkinter._TakeFocusValue = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -795,12 +795,12 @@ class Sizegrip(Widget):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
cursor: tkinter._Cursor = ...,
style: str = ...,
takefocus: tkinter._TakeFocusValue = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
@@ -840,7 +840,7 @@ if sys.version_info >= (3, 7):
@overload # type: ignore
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
background: tkinter._Color = ...,
command: Callable[[], Any] | str | tkinter._TkinterSequence[str] = ...,
@@ -865,7 +865,7 @@ if sys.version_info >= (3, 7):
width: int = ...,
wrap: bool = ...,
xscrollcommand: tkinter._XYScrollCommand = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure # type: ignore
@@ -927,7 +927,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
@overload
def configure(
self,
cnf: Dict[str, Any] | None = ...,
cnf: dict[str, Any] | None = ...,
*,
columns: str | tkinter._TkinterSequence[str] = ...,
cursor: tkinter._Cursor = ...,
@@ -940,7 +940,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
takefocus: tkinter._TakeFocusValue = ...,
xscrollcommand: tkinter._XYScrollCommand = ...,
yscrollcommand: tkinter._XYScrollCommand = ...,
) -> Dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure