mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-24 20:12:08 +08:00
Add more defaults to the stdlib (#9606)
Continuing work towards #8988. The first five commits were created using stubdefaulter on various Python versions; the following commits were all created manually by me to fix various problems. The main things this adds that weren't present in #9501 are: - Defaults in Windows-only modules and Windows-only branches (because I'm running a Windows machine) - Defaults in non-py311 branches - Defaults for float parameters - Defaults for overloads
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -11,10 +11,10 @@ class Chooser(Dialog):
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
def askcolor(
|
||||
color: str | bytes | None = ..., *, initialcolor: _Color = ..., parent: Misc = ..., title: str = ...
|
||||
color: str | bytes | None = None, *, initialcolor: _Color = ..., parent: Misc = ..., title: str = ...
|
||||
) -> tuple[None, None] | tuple[tuple[int, int, int], str]: ...
|
||||
|
||||
else:
|
||||
def askcolor(
|
||||
color: str | bytes | None = ..., *, initialcolor: _Color = ..., parent: Misc = ..., title: str = ...
|
||||
color: str | bytes | None = None, *, initialcolor: _Color = ..., parent: Misc = ..., title: str = ...
|
||||
) -> tuple[None, None] | tuple[tuple[float, float, float], str]: ...
|
||||
|
||||
@@ -10,5 +10,5 @@ class Dialog:
|
||||
command: ClassVar[str | None]
|
||||
master: Incomplete | None
|
||||
options: Mapping[str, Incomplete]
|
||||
def __init__(self, master: Incomplete | None = ..., **options: Incomplete) -> None: ...
|
||||
def __init__(self, master: Incomplete | None = None, **options: Incomplete) -> None: ...
|
||||
def show(self, **options: Incomplete) -> Incomplete: ...
|
||||
|
||||
@@ -12,5 +12,5 @@ DIALOG_ICON: str
|
||||
class Dialog(Widget):
|
||||
widgetName: str
|
||||
num: int
|
||||
def __init__(self, master: Incomplete | None = ..., cnf: Mapping[str, Any] = ..., **kw: Incomplete) -> None: ...
|
||||
def __init__(self, master: Incomplete | None = None, cnf: Mapping[str, Any] = ..., **kw: Incomplete) -> None: ...
|
||||
def destroy(self) -> None: ...
|
||||
|
||||
@@ -11,8 +11,8 @@ class _DndSource(Protocol):
|
||||
class DndHandler:
|
||||
root: ClassVar[Tk | None]
|
||||
def __init__(self, source: _DndSource, event: Event[Misc]) -> None: ...
|
||||
def cancel(self, event: Event[Misc] | None = ...) -> None: ...
|
||||
def finish(self, event: Event[Misc] | None, commit: int = ...) -> None: ...
|
||||
def cancel(self, event: Event[Misc] | None = None) -> None: ...
|
||||
def finish(self, event: Event[Misc] | None, commit: int = 0) -> None: ...
|
||||
def on_motion(self, event: Event[Misc]) -> None: ...
|
||||
def on_release(self, event: Event[Misc]) -> None: ...
|
||||
|
||||
|
||||
@@ -41,21 +41,21 @@ class FileDialog:
|
||||
filter_button: Button
|
||||
cancel_button: Button
|
||||
def __init__(
|
||||
self, master, title: Incomplete | None = ...
|
||||
self, master, title: Incomplete | None = None
|
||||
) -> None: ... # title is usually a str or None, but e.g. int doesn't raise en exception either
|
||||
how: Incomplete | None
|
||||
def go(self, dir_or_file=..., pattern: str = ..., default: str = ..., key: Incomplete | None = ...): ...
|
||||
def quit(self, how: Incomplete | None = ...) -> None: ...
|
||||
def go(self, dir_or_file=".", pattern: str = "*", default: str = "", key: Incomplete | None = None): ...
|
||||
def quit(self, how: Incomplete | None = None) -> None: ...
|
||||
def dirs_double_event(self, event) -> None: ...
|
||||
def dirs_select_event(self, event) -> None: ...
|
||||
def files_double_event(self, event) -> None: ...
|
||||
def files_select_event(self, event) -> None: ...
|
||||
def ok_event(self, event) -> None: ...
|
||||
def ok_command(self) -> None: ...
|
||||
def filter_command(self, event: Incomplete | None = ...) -> None: ...
|
||||
def filter_command(self, event: Incomplete | None = None) -> None: ...
|
||||
def get_filter(self): ...
|
||||
def get_selection(self): ...
|
||||
def cancel_command(self, event: Incomplete | None = ...) -> None: ...
|
||||
def cancel_command(self, event: Incomplete | None = None) -> None: ...
|
||||
def set_filter(self, dir, pat) -> None: ...
|
||||
def set_selection(self, file) -> None: ...
|
||||
|
||||
@@ -116,7 +116,7 @@ def askdirectory(
|
||||
|
||||
# TODO: If someone actually uses these, overload to have the actual return type of open(..., mode)
|
||||
def asksaveasfile(
|
||||
mode: str = ...,
|
||||
mode: str = "w",
|
||||
*,
|
||||
confirmoverwrite: bool | None = ...,
|
||||
defaultextension: str | None = ...,
|
||||
@@ -128,7 +128,7 @@ def asksaveasfile(
|
||||
typevariable: StringVar | str | None = ...,
|
||||
) -> IO[Incomplete] | None: ...
|
||||
def askopenfile(
|
||||
mode: str = ...,
|
||||
mode: str = "r",
|
||||
*,
|
||||
defaultextension: str | None = ...,
|
||||
filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ...,
|
||||
@@ -139,7 +139,7 @@ def askopenfile(
|
||||
typevariable: StringVar | str | None = ...,
|
||||
) -> IO[Incomplete] | None: ...
|
||||
def askopenfiles(
|
||||
mode: str = ...,
|
||||
mode: str = "r",
|
||||
*,
|
||||
defaultextension: str | None = ...,
|
||||
filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ...,
|
||||
|
||||
@@ -41,10 +41,10 @@ class Font:
|
||||
self,
|
||||
# In tkinter, 'root' refers to tkinter.Tk by convention, but the code
|
||||
# actually works with any tkinter widget so we use tkinter.Misc.
|
||||
root: tkinter.Misc | None = ...,
|
||||
font: _FontDescription | None = ...,
|
||||
name: str | None = ...,
|
||||
exists: bool = ...,
|
||||
root: tkinter.Misc | None = None,
|
||||
font: _FontDescription | None = None,
|
||||
name: str | None = None,
|
||||
exists: bool = False,
|
||||
*,
|
||||
family: str = ...,
|
||||
size: int = ...,
|
||||
@@ -68,19 +68,19 @@ class Font:
|
||||
def cget(self, option: str) -> Any: ...
|
||||
__getitem__ = cget
|
||||
@overload
|
||||
def actual(self, option: Literal["family"], displayof: tkinter.Misc | None = ...) -> str: ...
|
||||
def actual(self, option: Literal["family"], displayof: tkinter.Misc | None = None) -> str: ...
|
||||
@overload
|
||||
def actual(self, option: Literal["size"], displayof: tkinter.Misc | None = ...) -> int: ...
|
||||
def actual(self, option: Literal["size"], displayof: tkinter.Misc | None = None) -> int: ...
|
||||
@overload
|
||||
def actual(self, option: Literal["weight"], displayof: tkinter.Misc | None = ...) -> Literal["normal", "bold"]: ...
|
||||
def actual(self, option: Literal["weight"], displayof: tkinter.Misc | None = None) -> Literal["normal", "bold"]: ...
|
||||
@overload
|
||||
def actual(self, option: Literal["slant"], displayof: tkinter.Misc | None = ...) -> Literal["roman", "italic"]: ...
|
||||
def actual(self, option: Literal["slant"], displayof: tkinter.Misc | None = None) -> Literal["roman", "italic"]: ...
|
||||
@overload
|
||||
def actual(self, option: Literal["underline", "overstrike"], displayof: tkinter.Misc | None = ...) -> bool: ...
|
||||
def actual(self, option: Literal["underline", "overstrike"], displayof: tkinter.Misc | None = None) -> bool: ...
|
||||
@overload
|
||||
def actual(self, option: None, displayof: tkinter.Misc | None = ...) -> _FontDict: ...
|
||||
def actual(self, option: None, displayof: tkinter.Misc | None = None) -> _FontDict: ...
|
||||
@overload
|
||||
def actual(self, *, displayof: tkinter.Misc | None = ...) -> _FontDict: ...
|
||||
def actual(self, *, displayof: tkinter.Misc | None = None) -> _FontDict: ...
|
||||
def config(
|
||||
self,
|
||||
*,
|
||||
@@ -99,14 +99,14 @@ class Font:
|
||||
def metrics(self, __option: Literal["fixed"], *, displayof: tkinter.Misc | None = ...) -> bool: ...
|
||||
@overload
|
||||
def metrics(self, *, displayof: tkinter.Misc | None = ...) -> _MetricsDict: ...
|
||||
def measure(self, text: str, displayof: tkinter.Misc | None = ...) -> int: ...
|
||||
def measure(self, text: str, displayof: tkinter.Misc | None = None) -> int: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
|
||||
def families(root: tkinter.Misc | None = ..., displayof: tkinter.Misc | None = ...) -> tuple[str, ...]: ...
|
||||
def names(root: tkinter.Misc | None = ...) -> tuple[str, ...]: ...
|
||||
def families(root: tkinter.Misc | None = None, displayof: tkinter.Misc | None = None) -> tuple[str, ...]: ...
|
||||
def names(root: tkinter.Misc | None = None) -> tuple[str, ...]: ...
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
def nametofont(name: str, root: tkinter.Misc | None = ...) -> Font: ...
|
||||
def nametofont(name: str, root: tkinter.Misc | None = None) -> Font: ...
|
||||
|
||||
else:
|
||||
def nametofont(name: str) -> Font: ...
|
||||
|
||||
@@ -34,11 +34,11 @@ NO: str
|
||||
class Message(Dialog):
|
||||
command: ClassVar[str]
|
||||
|
||||
def showinfo(title: str | None = ..., message: str | None = ..., **options) -> str: ...
|
||||
def showwarning(title: str | None = ..., message: str | None = ..., **options) -> str: ...
|
||||
def showerror(title: str | None = ..., message: str | None = ..., **options) -> str: ...
|
||||
def askquestion(title: str | None = ..., message: str | None = ..., **options) -> str: ...
|
||||
def askokcancel(title: str | None = ..., message: str | None = ..., **options) -> bool: ...
|
||||
def askyesno(title: str | None = ..., message: str | None = ..., **options) -> bool: ...
|
||||
def askyesnocancel(title: str | None = ..., message: str | None = ..., **options) -> bool | None: ...
|
||||
def askretrycancel(title: str | None = ..., message: str | None = ..., **options) -> bool: ...
|
||||
def showinfo(title: str | None = None, message: str | None = None, **options) -> str: ...
|
||||
def showwarning(title: str | None = None, message: str | None = None, **options) -> str: ...
|
||||
def showerror(title: str | None = None, message: str | None = None, **options) -> str: ...
|
||||
def askquestion(title: str | None = None, message: str | None = None, **options) -> str: ...
|
||||
def askokcancel(title: str | None = None, message: str | None = None, **options) -> bool: ...
|
||||
def askyesno(title: str | None = None, message: str | None = None, **options) -> bool: ...
|
||||
def askyesnocancel(title: str | None = None, message: str | None = None, **options) -> bool | None: ...
|
||||
def askretrycancel(title: str | None = None, message: str | None = None, **options) -> bool: ...
|
||||
|
||||
@@ -7,4 +7,4 @@ __all__ = ["ScrolledText"]
|
||||
class ScrolledText(Text):
|
||||
frame: Frame
|
||||
vbar: Scrollbar
|
||||
def __init__(self, master: Misc | None = ..., **kwargs: Incomplete) -> None: ...
|
||||
def __init__(self, master: Misc | None = None, **kwargs: Incomplete) -> None: ...
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
from tkinter import Event, Frame, Misc, Toplevel
|
||||
|
||||
class Dialog(Toplevel):
|
||||
def __init__(self, parent: Misc | None, title: str | None = ...) -> None: ...
|
||||
def __init__(self, parent: Misc | None, title: str | None = None) -> None: ...
|
||||
def body(self, master: Frame) -> Misc | None: ...
|
||||
def buttonbox(self) -> None: ...
|
||||
def ok(self, event: Event[Misc] | None = ...) -> None: ...
|
||||
def cancel(self, event: Event[Misc] | None = ...) -> None: ...
|
||||
def ok(self, event: Event[Misc] | None = None) -> None: ...
|
||||
def cancel(self, event: Event[Misc] | None = None) -> None: ...
|
||||
def validate(self) -> bool: ...
|
||||
def apply(self) -> None: ...
|
||||
|
||||
@@ -13,12 +13,12 @@ class SimpleDialog:
|
||||
def __init__(
|
||||
self,
|
||||
master: Misc | None,
|
||||
text: str = ...,
|
||||
text: str = "",
|
||||
buttons: list[str] = ...,
|
||||
default: int | None = ...,
|
||||
cancel: int | None = ...,
|
||||
title: str | None = ...,
|
||||
class_: str | None = ...,
|
||||
default: int | None = None,
|
||||
cancel: int | None = None,
|
||||
title: str | None = None,
|
||||
class_: str | None = None,
|
||||
) -> None: ...
|
||||
def go(self) -> int | None: ...
|
||||
def return_event(self, event: Event[Misc]) -> None: ...
|
||||
|
||||
@@ -38,22 +38,22 @@ 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_filedialog(self, dlgclass: str | None = ...) -> str: ...
|
||||
def tix_configure(self, cnf: dict[str, Any] | None = None, **kw: Any) -> Any: ...
|
||||
def tix_filedialog(self, dlgclass: str | None = None) -> str: ...
|
||||
def tix_getbitmap(self, name: str) -> str: ...
|
||||
def tix_getimage(self, name: str) -> str: ...
|
||||
def tix_option_get(self, name: str) -> Any: ...
|
||||
def tix_resetoptions(self, newScheme: str, newFontSet: str, newScmPrio: str | None = ...) -> None: ...
|
||||
def tix_resetoptions(self, newScheme: str, newFontSet: str, newScmPrio: str | None = None) -> None: ...
|
||||
|
||||
class Tk(tkinter.Tk, tixCommand):
|
||||
def __init__(self, screenName: str | None = ..., baseName: str | None = ..., className: str = ...) -> None: ...
|
||||
def __init__(self, screenName: str | None = None, baseName: str | None = None, className: str = "Tix") -> None: ...
|
||||
|
||||
class TixWidget(tkinter.Widget):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
widgetName: str | None = ...,
|
||||
static_options: list[str] | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
widgetName: str | None = None,
|
||||
static_options: list[str] | None = None,
|
||||
cnf: dict[str, Any] = ...,
|
||||
kw: dict[str, Any] = ...,
|
||||
) -> None: ...
|
||||
@@ -62,52 +62,50 @@ class TixWidget(tkinter.Widget):
|
||||
def subwidget(self, name: str) -> 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) -> None: ...
|
||||
def image_create(self, imgtype: str, cnf: dict[str, Any] = ..., master: tkinter.Widget | None = None, **kw) -> None: ...
|
||||
def image_delete(self, imgname: str) -> None: ...
|
||||
|
||||
class TixSubWidget(TixWidget):
|
||||
def __init__(
|
||||
self, master: tkinter.Widget, name: str, destroy_physically: int = ..., check_intermediate: int = ...
|
||||
) -> None: ...
|
||||
def __init__(self, master: tkinter.Widget, name: str, destroy_physically: int = 1, check_intermediate: int = 1) -> None: ...
|
||||
|
||||
class DisplayStyle:
|
||||
def __init__(self, itemtype: str, cnf: dict[str, Any] = ..., *, master: tkinter.Widget | None = ..., **kw) -> None: ...
|
||||
def __init__(self, itemtype: str, cnf: dict[str, Any] = ..., *, master: tkinter.Widget | None = None, **kw) -> None: ...
|
||||
def __getitem__(self, key: str): ...
|
||||
def __setitem__(self, key: str, value: Any) -> None: ...
|
||||
def delete(self) -> None: ...
|
||||
def config(self, cnf: dict[str, Any] = ..., **kw): ...
|
||||
|
||||
class Balloon(TixWidget):
|
||||
def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
def bind_widget(self, widget: tkinter.Widget, cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
def unbind_widget(self, widget: tkinter.Widget) -> None: ...
|
||||
|
||||
class ButtonBox(TixWidget):
|
||||
def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
def add(self, name: str, cnf: dict[str, Any] = ..., **kw) -> tkinter.Widget: ...
|
||||
def invoke(self, name: str) -> None: ...
|
||||
|
||||
class ComboBox(TixWidget):
|
||||
def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> 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) -> None: ...
|
||||
def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> 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) -> None: ...
|
||||
def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
|
||||
class LabelFrame(TixWidget):
|
||||
def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
|
||||
class Meter(TixWidget):
|
||||
def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
|
||||
class OptionMenu(TixWidget):
|
||||
def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
@@ -129,7 +127,7 @@ class Select(TixWidget):
|
||||
def invoke(self, name: str) -> None: ...
|
||||
|
||||
class StdButtonBox(TixWidget):
|
||||
def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
def invoke(self, name: str) -> None: ...
|
||||
|
||||
class DirList(TixWidget):
|
||||
@@ -164,13 +162,13 @@ class FileEntry(TixWidget):
|
||||
def file_dialog(self) -> None: ...
|
||||
|
||||
class HList(TixWidget, tkinter.XView, tkinter.YView):
|
||||
def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
def add(self, entry: str, cnf: dict[str, Any] = ..., **kw) -> tkinter.Widget: ...
|
||||
def add_child(self, parent: str | None = ..., cnf: dict[str, Any] = ..., **kw) -> tkinter.Widget: ...
|
||||
def add_child(self, parent: str | None = None, cnf: dict[str, Any] = ..., **kw) -> tkinter.Widget: ...
|
||||
def anchor_set(self, entry: str) -> None: ...
|
||||
def anchor_clear(self) -> None: ...
|
||||
# FIXME: Overload, certain combos return, others don't
|
||||
def column_width(self, col: int = ..., width: int | None = ..., chars: int | None = ...) -> int | None: ...
|
||||
def column_width(self, col: int = 0, width: int | None = None, chars: int | None = None) -> int | None: ...
|
||||
def delete_all(self) -> None: ...
|
||||
def delete_entry(self, entry: str) -> None: ...
|
||||
def delete_offsprings(self, entry: str) -> None: ...
|
||||
@@ -195,7 +193,7 @@ class HList(TixWidget, tkinter.XView, tkinter.YView):
|
||||
def indicator_size(self, entry: str) -> int: ...
|
||||
def info_anchor(self) -> str: ...
|
||||
def info_bbox(self, entry: str) -> tuple[int, int, int, int]: ...
|
||||
def info_children(self, entry: str | None = ...) -> tuple[str, ...]: ...
|
||||
def info_children(self, entry: str | None = None) -> tuple[str, ...]: ...
|
||||
def info_data(self, entry: str) -> Any: ...
|
||||
def info_dragsite(self) -> str: ...
|
||||
def info_dropsite(self) -> str: ...
|
||||
@@ -216,34 +214,34 @@ class HList(TixWidget, tkinter.XView, tkinter.YView):
|
||||
def see(self, entry: str) -> None: ...
|
||||
def selection_clear(self, cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
def selection_includes(self, entry: str) -> bool: ...
|
||||
def selection_set(self, first: str, last: str | None = ...) -> None: ...
|
||||
def selection_set(self, first: str, last: str | None = None) -> None: ...
|
||||
def show_entry(self, entry: str) -> None: ...
|
||||
|
||||
class CheckList(TixWidget):
|
||||
def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
def autosetmode(self) -> None: ...
|
||||
def close(self, entrypath: str) -> None: ...
|
||||
def getmode(self, entrypath: str) -> str: ...
|
||||
def open(self, entrypath: str) -> None: ...
|
||||
def getselection(self, mode: str = ...) -> tuple[str, ...]: ...
|
||||
def getselection(self, mode: str = "on") -> tuple[str, ...]: ...
|
||||
def getstatus(self, entrypath: str) -> str: ...
|
||||
def setstatus(self, entrypath: str, mode: str = ...) -> None: ...
|
||||
def setstatus(self, entrypath: str, mode: str = "on") -> None: ...
|
||||
|
||||
class Tree(TixWidget):
|
||||
def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
def autosetmode(self) -> None: ...
|
||||
def close(self, entrypath: str) -> None: ...
|
||||
def getmode(self, entrypath: str) -> str: ...
|
||||
def open(self, entrypath: str) -> None: ...
|
||||
def setmode(self, entrypath: str, mode: str = ...) -> None: ...
|
||||
def setmode(self, entrypath: str, mode: str = "none") -> None: ...
|
||||
|
||||
class TList(TixWidget, tkinter.XView, tkinter.YView):
|
||||
def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
def active_set(self, index: int) -> None: ...
|
||||
def active_clear(self) -> None: ...
|
||||
def anchor_set(self, index: int) -> None: ...
|
||||
def anchor_clear(self) -> None: ...
|
||||
def delete(self, from_: int, to: int | None = ...) -> None: ...
|
||||
def delete(self, from_: int, to: int | None = None) -> None: ...
|
||||
def dragsite_set(self, index: int) -> None: ...
|
||||
def dragsite_clear(self) -> None: ...
|
||||
def dropsite_set(self, index: int) -> None: ...
|
||||
@@ -261,7 +259,7 @@ class TList(TixWidget, tkinter.XView, tkinter.YView):
|
||||
def see(self, index: int) -> None: ...
|
||||
def selection_clear(self, cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
def selection_includes(self, index: int) -> bool: ...
|
||||
def selection_set(self, first: int, last: int | None = ...) -> None: ...
|
||||
def selection_set(self, first: int, last: int | None = None) -> None: ...
|
||||
|
||||
class PanedWindow(TixWidget):
|
||||
def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
@@ -280,7 +278,7 @@ class ListNoteBook(TixWidget):
|
||||
def raise_page(self, name: str) -> None: ...
|
||||
|
||||
class NoteBook(TixWidget):
|
||||
def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
def add(self, name: str, cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
def delete(self, name: str) -> None: ...
|
||||
def page(self, name: str) -> tkinter.Widget: ...
|
||||
@@ -289,7 +287,7 @@ class NoteBook(TixWidget):
|
||||
def raised(self) -> bool: ...
|
||||
|
||||
class InputOnly(TixWidget):
|
||||
def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ...
|
||||
|
||||
class Form:
|
||||
def __setitem__(self, key: str, value: Any) -> None: ...
|
||||
@@ -297,6 +295,6 @@ class Form:
|
||||
def form(self, cnf: dict[str, Any] = ..., **kw) -> 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 = ...): ...
|
||||
def grid(self, xsize: int = 0, ysize: int = 0) -> tuple[int, int] | None: ...
|
||||
def info(self, option: str | None = None): ...
|
||||
def slaves(self) -> list[tkinter.Widget]: ...
|
||||
|
||||
@@ -36,7 +36,7 @@ __all__ = [
|
||||
]
|
||||
|
||||
def tclobjs_to_py(adict: dict[Any, Any]) -> dict[Any, Any]: ...
|
||||
def setup_master(master: Incomplete | None = ...): ...
|
||||
def setup_master(master: Incomplete | None = None): ...
|
||||
|
||||
_Padding: TypeAlias = Union[
|
||||
tkinter._ScreenUnits,
|
||||
@@ -52,32 +52,32 @@ _TtkCompound: TypeAlias = Literal["text", "image", tkinter._Compound]
|
||||
class Style:
|
||||
master: Incomplete
|
||||
tk: _tkinter.TkappType
|
||||
def __init__(self, master: tkinter.Misc | None = ...) -> None: ...
|
||||
def configure(self, style, query_opt: Incomplete | None = ..., **kw): ...
|
||||
def map(self, style, query_opt: Incomplete | None = ..., **kw): ...
|
||||
def lookup(self, style, option, state: Incomplete | None = ..., default: Incomplete | None = ...): ...
|
||||
def layout(self, style, layoutspec: Incomplete | None = ...): ...
|
||||
def __init__(self, master: tkinter.Misc | None = None) -> None: ...
|
||||
def configure(self, style, query_opt: Incomplete | None = None, **kw): ...
|
||||
def map(self, style, query_opt: Incomplete | None = None, **kw): ...
|
||||
def lookup(self, style, option, state: Incomplete | None = None, default: Incomplete | None = None): ...
|
||||
def layout(self, style, layoutspec: Incomplete | None = None): ...
|
||||
def element_create(self, elementname, etype, *args, **kw) -> None: ...
|
||||
def element_names(self): ...
|
||||
def element_options(self, elementname): ...
|
||||
def theme_create(self, themename, parent: Incomplete | None = ..., settings: Incomplete | None = ...) -> None: ...
|
||||
def theme_create(self, themename, parent: Incomplete | None = None, settings: Incomplete | None = None) -> None: ...
|
||||
def theme_settings(self, themename, settings) -> None: ...
|
||||
def theme_names(self) -> tuple[str, ...]: ...
|
||||
@overload
|
||||
def theme_use(self, themename: str) -> None: ...
|
||||
@overload
|
||||
def theme_use(self, themename: None = ...) -> str: ...
|
||||
def theme_use(self, themename: None = None) -> str: ...
|
||||
|
||||
class Widget(tkinter.Widget):
|
||||
def __init__(self, master: tkinter.Misc | None, widgetname, kw: Incomplete | None = ...) -> None: ...
|
||||
def __init__(self, master: tkinter.Misc | None, widgetname, kw: Incomplete | None = None) -> None: ...
|
||||
def identify(self, x: int, y: int) -> str: ...
|
||||
def instate(self, statespec, callback: Incomplete | None = ..., *args, **kw): ...
|
||||
def state(self, statespec: Incomplete | None = ...): ...
|
||||
def instate(self, statespec, callback: Incomplete | None = None, *args, **kw): ...
|
||||
def state(self, statespec: Incomplete | None = None): ...
|
||||
|
||||
class Button(Widget):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
class_: str = ...,
|
||||
command: tkinter._ButtonCommand = ...,
|
||||
@@ -98,7 +98,7 @@ class Button(Widget):
|
||||
@overload
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
command: tkinter._ButtonCommand = ...,
|
||||
compound: _TtkCompound = ...,
|
||||
@@ -122,7 +122,7 @@ class Button(Widget):
|
||||
class Checkbutton(Widget):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
class_: str = ...,
|
||||
command: tkinter._ButtonCommand = ...,
|
||||
@@ -148,7 +148,7 @@ class Checkbutton(Widget):
|
||||
@overload
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
command: tkinter._ButtonCommand = ...,
|
||||
compound: _TtkCompound = ...,
|
||||
@@ -174,8 +174,8 @@ class Checkbutton(Widget):
|
||||
class Entry(Widget, tkinter.Entry):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
widget: str | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
widget: str | None = None,
|
||||
*,
|
||||
background: tkinter._Color = ..., # undocumented
|
||||
class_: str = ...,
|
||||
@@ -199,7 +199,7 @@ class Entry(Widget, tkinter.Entry):
|
||||
@overload # type: ignore[override]
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
background: tkinter._Color = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -224,7 +224,7 @@ class Entry(Widget, tkinter.Entry):
|
||||
@overload # type: ignore[override]
|
||||
def config(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
background: tkinter._Color = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -252,7 +252,7 @@ class Entry(Widget, tkinter.Entry):
|
||||
class Combobox(Entry):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
background: tkinter._Color = ..., # undocumented
|
||||
class_: str = ...,
|
||||
@@ -279,7 +279,7 @@ class Combobox(Entry):
|
||||
@overload # type: ignore[override]
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
background: tkinter._Color = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -307,7 +307,7 @@ class Combobox(Entry):
|
||||
@overload # type: ignore[override]
|
||||
def config(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
background: tkinter._Color = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -331,13 +331,13 @@ class Combobox(Entry):
|
||||
) -> 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: int | None = ...) -> int: ...
|
||||
def current(self, newindex: int | None = None) -> int: ...
|
||||
def set(self, value: Any) -> None: ...
|
||||
|
||||
class Frame(Widget):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
border: tkinter._ScreenUnits = ...,
|
||||
borderwidth: tkinter._ScreenUnits = ...,
|
||||
@@ -354,7 +354,7 @@ class Frame(Widget):
|
||||
@overload
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
border: tkinter._ScreenUnits = ...,
|
||||
borderwidth: tkinter._ScreenUnits = ...,
|
||||
@@ -373,7 +373,7 @@ class Frame(Widget):
|
||||
class Label(Widget):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
anchor: tkinter._Anchor = ...,
|
||||
background: tkinter._Color = ...,
|
||||
@@ -401,7 +401,7 @@ class Label(Widget):
|
||||
@overload
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
anchor: tkinter._Anchor = ...,
|
||||
background: tkinter._Color = ...,
|
||||
@@ -431,7 +431,7 @@ class Label(Widget):
|
||||
class Labelframe(Widget):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
border: tkinter._ScreenUnits = ...,
|
||||
borderwidth: tkinter._ScreenUnits = ..., # undocumented
|
||||
@@ -452,7 +452,7 @@ class Labelframe(Widget):
|
||||
@overload
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
border: tkinter._ScreenUnits = ...,
|
||||
borderwidth: tkinter._ScreenUnits = ...,
|
||||
@@ -477,7 +477,7 @@ LabelFrame = Labelframe
|
||||
class Menubutton(Widget):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
class_: str = ...,
|
||||
compound: _TtkCompound = ...,
|
||||
@@ -498,7 +498,7 @@ class Menubutton(Widget):
|
||||
@overload
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
compound: _TtkCompound = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -521,7 +521,7 @@ class Menubutton(Widget):
|
||||
class Notebook(Widget):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
class_: str = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -535,7 +535,7 @@ class Notebook(Widget):
|
||||
@overload
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
height: int = ...,
|
||||
@@ -564,15 +564,15 @@ class Notebook(Widget):
|
||||
def identify(self, x: int, y: int) -> str: ...
|
||||
def index(self, tab_id): ...
|
||||
def insert(self, pos, child, **kw) -> None: ...
|
||||
def select(self, tab_id: Incomplete | None = ...): ...
|
||||
def tab(self, tab_id, option: Incomplete | None = ..., **kw): ...
|
||||
def select(self, tab_id: Incomplete | None = None): ...
|
||||
def tab(self, tab_id, option: Incomplete | None = None, **kw): ...
|
||||
def tabs(self): ...
|
||||
def enable_traversal(self) -> None: ...
|
||||
|
||||
class Panedwindow(Widget, tkinter.PanedWindow):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
class_: str = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -588,7 +588,7 @@ class Panedwindow(Widget, tkinter.PanedWindow):
|
||||
@overload # type: ignore[override]
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
height: int = ...,
|
||||
@@ -602,7 +602,7 @@ class Panedwindow(Widget, tkinter.PanedWindow):
|
||||
@overload # type: ignore[override]
|
||||
def config(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
height: int = ...,
|
||||
@@ -614,15 +614,15 @@ class Panedwindow(Widget, tkinter.PanedWindow):
|
||||
def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
|
||||
forget: Incomplete
|
||||
def insert(self, pos, child, **kw) -> None: ...
|
||||
def pane(self, pane, option: Incomplete | None = ..., **kw): ...
|
||||
def sashpos(self, index, newpos: Incomplete | None = ...): ...
|
||||
def pane(self, pane, option: Incomplete | None = None, **kw): ...
|
||||
def sashpos(self, index, newpos: Incomplete | None = None): ...
|
||||
|
||||
PanedWindow = Panedwindow
|
||||
|
||||
class Progressbar(Widget):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
class_: str = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -640,7 +640,7 @@ class Progressbar(Widget):
|
||||
@overload
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
length: tkinter._ScreenUnits = ...,
|
||||
@@ -656,14 +656,14 @@ class Progressbar(Widget):
|
||||
@overload
|
||||
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
|
||||
config = configure
|
||||
def start(self, interval: Literal["idle"] | int | None = ...) -> None: ...
|
||||
def step(self, amount: float | None = ...) -> None: ...
|
||||
def start(self, interval: Literal["idle"] | int | None = None) -> None: ...
|
||||
def step(self, amount: float | None = None) -> None: ...
|
||||
def stop(self) -> None: ...
|
||||
|
||||
class Radiobutton(Widget):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
class_: str = ...,
|
||||
command: tkinter._ButtonCommand = ...,
|
||||
@@ -685,7 +685,7 @@ class Radiobutton(Widget):
|
||||
@overload
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
command: tkinter._ButtonCommand = ...,
|
||||
compound: _TtkCompound = ...,
|
||||
@@ -711,7 +711,7 @@ class Radiobutton(Widget):
|
||||
class Scale(Widget, tkinter.Scale): # type: ignore[misc]
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
class_: str = ...,
|
||||
command: str | Callable[[str], object] = ...,
|
||||
@@ -730,7 +730,7 @@ class Scale(Widget, tkinter.Scale): # type: ignore[misc]
|
||||
@overload # type: ignore[override]
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
command: str | Callable[[str], object] = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -750,7 +750,7 @@ class Scale(Widget, tkinter.Scale): # type: ignore[misc]
|
||||
@overload # type: ignore[override]
|
||||
def config(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
command: str | Callable[[str], object] = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -766,13 +766,13 @@ class Scale(Widget, tkinter.Scale): # type: ignore[misc]
|
||||
) -> 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: int | None = ..., y: int | None = ...) -> float: ...
|
||||
def get(self, x: int | None = None, y: int | None = None) -> float: ...
|
||||
|
||||
# type ignore, because identify() methods of Widget and tkinter.Scale are incompatible
|
||||
class Scrollbar(Widget, tkinter.Scrollbar): # type: ignore[misc]
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
class_: str = ...,
|
||||
command: Callable[..., tuple[float, float] | None] | str = ...,
|
||||
@@ -785,7 +785,7 @@ class Scrollbar(Widget, tkinter.Scrollbar): # type: ignore[misc]
|
||||
@overload # type: ignore[override]
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
command: Callable[..., tuple[float, float] | None] | str = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -799,7 +799,7 @@ class Scrollbar(Widget, tkinter.Scrollbar): # type: ignore[misc]
|
||||
@overload # type: ignore[override]
|
||||
def config(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
command: Callable[..., tuple[float, float] | None] | str = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -813,7 +813,7 @@ class Scrollbar(Widget, tkinter.Scrollbar): # type: ignore[misc]
|
||||
class Separator(Widget):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
class_: str = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -825,7 +825,7 @@ class Separator(Widget):
|
||||
@overload
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
orient: Literal["horizontal", "vertical"] = ...,
|
||||
@@ -839,7 +839,7 @@ class Separator(Widget):
|
||||
class Sizegrip(Widget):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
class_: str = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -850,7 +850,7 @@ class Sizegrip(Widget):
|
||||
@overload
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
style: str = ...,
|
||||
@@ -863,7 +863,7 @@ class Sizegrip(Widget):
|
||||
class Spinbox(Entry):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
background: tkinter._Color = ..., # undocumented
|
||||
class_: str = ...,
|
||||
@@ -894,7 +894,7 @@ class Spinbox(Entry):
|
||||
@overload # type: ignore[override]
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
background: tkinter._Color = ...,
|
||||
command: Callable[[], object] | str | list[str] | tuple[str, ...] = ...,
|
||||
@@ -958,7 +958,7 @@ _TreeviewColumnId: TypeAlias = int | str # manual page: "COLUMN IDENTIFIERS"
|
||||
class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
class_: str = ...,
|
||||
columns: str | list[str] | tuple[str, ...] = ...,
|
||||
@@ -981,7 +981,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
@overload
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
columns: str | list[str] | tuple[str, ...] = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -998,8 +998,8 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
@overload
|
||||
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
|
||||
config = configure
|
||||
def bbox(self, item, column: _TreeviewColumnId | None = ...) -> tuple[int, int, int, int] | Literal[""]: ... # type: ignore[override]
|
||||
def get_children(self, item: str | None = ...) -> tuple[str, ...]: ...
|
||||
def bbox(self, item, column: _TreeviewColumnId | None = None) -> tuple[int, int, int, int] | Literal[""]: ... # type: ignore[override]
|
||||
def get_children(self, item: str | None = None) -> tuple[str, ...]: ...
|
||||
def set_children(self, item: str, *newchildren: str) -> None: ...
|
||||
@overload
|
||||
def column(self, column: _TreeviewColumnId, option: Literal["width", "minwidth"]) -> int: ...
|
||||
@@ -1015,7 +1015,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
def column(
|
||||
self,
|
||||
column: _TreeviewColumnId,
|
||||
option: None = ...,
|
||||
option: None = None,
|
||||
*,
|
||||
width: int = ...,
|
||||
minwidth: int = ...,
|
||||
@@ -1027,7 +1027,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
def detach(self, *items: str) -> None: ...
|
||||
def exists(self, item: str) -> bool: ...
|
||||
@overload # type: ignore[override]
|
||||
def focus(self, item: None = ...) -> str: ... # can return empty string
|
||||
def focus(self, item: None = None) -> str: ... # can return empty string
|
||||
@overload
|
||||
def focus(self, item: str) -> Literal[""]: ...
|
||||
@overload
|
||||
@@ -1041,12 +1041,12 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
@overload
|
||||
def heading(self, column: _TreeviewColumnId, option: str) -> Any: ...
|
||||
@overload
|
||||
def heading(self, column: _TreeviewColumnId, option: None = ...) -> _TreeviewHeaderDict: ... # type: ignore[misc]
|
||||
def heading(self, column: _TreeviewColumnId, option: None = None) -> _TreeviewHeaderDict: ... # type: ignore[misc]
|
||||
@overload
|
||||
def heading(
|
||||
self,
|
||||
column: _TreeviewColumnId,
|
||||
option: None = ...,
|
||||
option: None = None,
|
||||
*,
|
||||
text: str = ...,
|
||||
image: tkinter._ImageSpec = ...,
|
||||
@@ -1063,7 +1063,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
self,
|
||||
parent: str,
|
||||
index: int | Literal["end"],
|
||||
iid: str | None = ...,
|
||||
iid: str | None = None,
|
||||
*,
|
||||
id: str = ..., # same as iid
|
||||
text: str = ...,
|
||||
@@ -1085,12 +1085,12 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
@overload
|
||||
def item(self, item: str, option: str) -> Any: ...
|
||||
@overload
|
||||
def item(self, item: str, option: None = ...) -> _TreeviewItemDict: ... # type: ignore[misc]
|
||||
def item(self, item: str, option: None = None) -> _TreeviewItemDict: ... # type: ignore[misc]
|
||||
@overload
|
||||
def item(
|
||||
self,
|
||||
item: str,
|
||||
option: None = ...,
|
||||
option: None = None,
|
||||
*,
|
||||
text: str = ...,
|
||||
image: tkinter._ImageSpec = ...,
|
||||
@@ -1107,23 +1107,23 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
if sys.version_info >= (3, 8):
|
||||
def selection(self) -> tuple[str, ...]: ...
|
||||
else:
|
||||
def selection(self, selop: Incomplete | None = ..., items: Incomplete | None = ...) -> tuple[str, ...]: ...
|
||||
def selection(self, selop: Incomplete | None = ..., items: Incomplete | None = None) -> tuple[str, ...]: ...
|
||||
|
||||
def selection_set(self, items: str | list[str] | tuple[str, ...]) -> None: ...
|
||||
def selection_add(self, items: str | list[str] | tuple[str, ...]) -> None: ...
|
||||
def selection_remove(self, items: str | list[str] | tuple[str, ...]) -> None: ...
|
||||
def selection_toggle(self, items: str | list[str] | tuple[str, ...]) -> None: ...
|
||||
@overload
|
||||
def set(self, item: str, column: None = ..., value: None = ...) -> dict[str, Any]: ...
|
||||
def set(self, item: str, column: None = None, value: None = None) -> dict[str, Any]: ...
|
||||
@overload
|
||||
def set(self, item: str, column: _TreeviewColumnId, value: None = ...) -> Any: ...
|
||||
def set(self, item: str, column: _TreeviewColumnId, value: None = None) -> Any: ...
|
||||
@overload
|
||||
def set(self, item: str, column: _TreeviewColumnId, value: Any) -> Literal[""]: ...
|
||||
# There's no tag_unbind() or 'add' argument for whatever reason.
|
||||
# Also, it's 'callback' instead of 'func' here.
|
||||
@overload
|
||||
def tag_bind(
|
||||
self, tagname: str, sequence: str | None = ..., callback: Callable[[tkinter.Event[Treeview]], object] | None = ...
|
||||
self, tagname: str, sequence: str | None = None, callback: Callable[[tkinter.Event[Treeview]], object] | None = None
|
||||
) -> str: ...
|
||||
@overload
|
||||
def tag_bind(self, tagname: str, sequence: str | None, callback: str) -> None: ...
|
||||
@@ -1139,7 +1139,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
def tag_configure(
|
||||
self,
|
||||
tagname: str,
|
||||
option: None = ...,
|
||||
option: None = None,
|
||||
*,
|
||||
# There is also 'text' and 'anchor', but they don't seem to do anything, using them is likely a bug
|
||||
foreground: tkinter._Color = ...,
|
||||
@@ -1148,7 +1148,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
image: tkinter._ImageSpec = ...,
|
||||
) -> _TreeviewTagDict | Any: ... # can be None but annoying to check
|
||||
@overload
|
||||
def tag_has(self, tagname: str, item: None = ...) -> tuple[str, ...]: ...
|
||||
def tag_has(self, tagname: str, item: None = None) -> tuple[str, ...]: ...
|
||||
@overload
|
||||
def tag_has(self, tagname: str, item: str) -> bool: ...
|
||||
|
||||
@@ -1158,10 +1158,10 @@ class LabeledScale(Frame):
|
||||
# TODO: don't any-type **kw. That goes to Frame.__init__.
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
variable: tkinter.IntVar | tkinter.DoubleVar | None = ...,
|
||||
from_: float = ...,
|
||||
to: float = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
variable: tkinter.IntVar | tkinter.DoubleVar | None = None,
|
||||
from_: float = 0,
|
||||
to: float = 10,
|
||||
*,
|
||||
compound: Literal["top", "bottom"] = ...,
|
||||
**kw,
|
||||
@@ -1174,7 +1174,7 @@ class OptionMenu(Menubutton):
|
||||
self,
|
||||
master,
|
||||
variable,
|
||||
default: str | None = ...,
|
||||
default: str | None = None,
|
||||
*values: str,
|
||||
# rest of these are keyword-only because *args syntax used above
|
||||
style: str = ...,
|
||||
@@ -1183,4 +1183,4 @@ class OptionMenu(Menubutton):
|
||||
) -> None: ...
|
||||
# configure, config, cget, destroy are inherited from Menubutton
|
||||
# destroy and __setitem__ are overridden, signature does not change
|
||||
def set_menu(self, default: Incomplete | None = ..., *values) -> None: ...
|
||||
def set_menu(self, default: Incomplete | None = None, *values) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user