Skip to content

add tkinter.tix.Form to the bases of tkinter.Widget #12751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion stdlib/tkinter/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import sys
from _typeshed import Incomplete, StrEnum, StrOrBytesPath
from collections.abc import Callable, Iterable, Mapping, Sequence
from tkinter import tix
from tkinter.constants import *
from tkinter.font import _FontDescription
from types import TracebackType
Expand Down Expand Up @@ -920,7 +921,8 @@
def destroy(self) -> None: ...

# This class represents any widget except Toplevel or Tk.
class Widget(BaseWidget, Pack, Place, Grid):
# At runtime, tix.Form is added to __bases__ dynamically.
class Widget(BaseWidget, Pack, Place, Grid, tix.Form):
# Allow bind callbacks to take e.g. Event[Label] instead of Event[Misc].
# Tk and Toplevel get notified for their child widgets' events, but other
# widgets don't.
Expand Down Expand Up @@ -1088,7 +1090,7 @@
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
config = configure

Check failure on line 1093 in stdlib/tkinter/__init__.pyi

View workflow job for this annotation

GitHub Actions / Test typeshed with pyright (Linux, 3.12)

Type "Overload[(self: Self@Button, cnf: dict[str, Any] | None = None, *, activebackground: str = ..., activeforeground: str = ..., anchor: _Anchor = ..., background: str = ..., bd: _ScreenUnits = ..., bg: str = ..., bitmap: str = ..., border: _ScreenUnits = ..., borderwidth: _ScreenUnits = ..., command: _ButtonCommand = ..., compound: _Compound = ..., cursor: _Cursor = ..., default: Literal['normal', 'active', 'disabled'] = ..., disabledforeground: str = ..., fg: str = ..., font: _FontDescription = ..., foreground: str = ..., height: _ScreenUnits = ..., highlightbackground: str = ..., highlightcolor: str = ..., highlightthickness: _ScreenUnits = ..., image: _ImageSpec = ..., justify: Literal['left', 'center', 'right'] = ..., overrelief: _Relief | Literal[''] = ..., padx: _ScreenUnits = ..., pady: _ScreenUnits = ..., relief: _Relief = ..., repeatdelay: int = ..., repeatinterval: int = ..., state: Literal['normal', 'active', 'disabled'] = ..., takefocus: _TakeFocusValue = ..., text: float | str = ..., textvariable: Variable = ..., underline: int = ..., width: _ScreenUnits = ..., wraplength: _ScreenUnits = ...) -> (dict[str, tuple[str, str, str, Any, Any]] | None), (self: Self@Button, cnf: str) -> tuple[str, str, str, Any, Any]]" is not assignable to declared type "(self: Self@Form, cnf: dict[str, Any] = {}, **kw: Unknown) -> None"   No overloaded function matches type "(self: Self@Form, cnf: dict[str, Any] = {}, **kw: Unknown) -> None" (reportAssignmentType)
def flash(self) -> None: ...
def invoke(self) -> Any: ...

Expand Down Expand Up @@ -1173,7 +1175,7 @@
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
config = configure

Check failure on line 1178 in stdlib/tkinter/__init__.pyi

View workflow job for this annotation

GitHub Actions / Test typeshed with pyright (Linux, 3.12)

Type "Overload[(self: Self@Canvas, cnf: dict[str, Any] | None = None, *, background: str = ..., bd: _ScreenUnits = ..., bg: str = ..., border: _ScreenUnits = ..., borderwidth: _ScreenUnits = ..., closeenough: float = ..., confine: bool = ..., cursor: _Cursor = ..., height: _ScreenUnits = ..., highlightbackground: str = ..., highlightcolor: str = ..., highlightthickness: _ScreenUnits = ..., insertbackground: str = ..., insertborderwidth: _ScreenUnits = ..., insertofftime: int = ..., insertontime: int = ..., insertwidth: _ScreenUnits = ..., offset: ... = ..., relief: _Relief = ..., scrollregion: tuple[_ScreenUnits, _ScreenUnits, _ScreenUnits, _ScreenUnits] | tuple[()] = ..., selectbackground: str = ..., selectborderwidth: _ScreenUnits = ..., selectforeground: str = ..., state: Literal['normal', 'disabled'] = ..., takefocus: _TakeFocusValue = ..., width: _ScreenUnits = ..., xscrollcommand: _XYScrollCommand = ..., xscrollincrement: _ScreenUnits = ..., yscrollcommand: _XYScrollCommand = ..., yscrollincrement: _ScreenUnits = ...) -> (dict[str, tuple[str, str, str, Any, Any]] | None), (self: Self@Canvas, cnf: str) -> tuple[str, str, str, Any, Any]]" is not assignable to declared type "(self: Self@Form, cnf: dict[str, Any] = {}, **kw: Unknown) -> None"   No overloaded function matches type "(self: Self@Form, cnf: dict[str, Any] = {}, **kw: Unknown) -> None" (reportAssignmentType)
def addtag(self, *args): ... # internal method
def addtag_above(self, newtag: str, tagOrId: str | int) -> None: ...
def addtag_all(self, newtag: str) -> None: ...
Expand Down Expand Up @@ -1859,7 +1861,7 @@
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
config = configure

Check failure on line 1864 in stdlib/tkinter/__init__.pyi

View workflow job for this annotation

GitHub Actions / Test typeshed with pyright (Linux, 3.12)

Type "Overload[(self: Self@Checkbutton, cnf: dict[str, Any] | None = None, *, activebackground: str = ..., activeforeground: str = ..., anchor: _Anchor = ..., background: str = ..., bd: _ScreenUnits = ..., bg: str = ..., bitmap: str = ..., border: _ScreenUnits = ..., borderwidth: _ScreenUnits = ..., command: _ButtonCommand = ..., compound: _Compound = ..., cursor: _Cursor = ..., disabledforeground: str = ..., fg: str = ..., font: _FontDescription = ..., foreground: str = ..., height: _ScreenUnits = ..., highlightbackground: str = ..., highlightcolor: str = ..., highlightthickness: _ScreenUnits = ..., image: _ImageSpec = ..., indicatoron: bool = ..., justify: Literal['left', 'center', 'right'] = ..., offrelief: _Relief = ..., offvalue: Any = ..., onvalue: Any = ..., overrelief: _Relief | Literal[''] = ..., padx: _ScreenUnits = ..., pady: _ScreenUnits = ..., relief: _Relief = ..., selectcolor: str = ..., selectimage: _ImageSpec = ..., state: Literal['normal', 'active', 'disabled'] = ..., takefocus: _TakeFocusValue = ..., text: float | str = ..., textvariable: Variable = ..., tristateimage: _ImageSpec = ..., tristatevalue: Any = ..., underline: int = ..., variable: Variable | Literal[''] = ..., width: _ScreenUnits = ..., wraplength: _ScreenUnits = ...) -> (dict[str, tuple[str, str, str, Any, Any]] | None), (self: Self@Checkbutton, cnf: str) -> tuple[str, str, str, Any, Any]]" is not assignable to declared type "(self: Self@Form, cnf: dict[str, Any] = {}, **kw: Unknown) -> None"   No overloaded function matches type "(self: Self@Form, cnf: dict[str, Any] = {}, **kw: Unknown) -> None" (reportAssignmentType)
def deselect(self) -> None: ...
def flash(self) -> None: ...
def invoke(self) -> Any: ...
Expand Down Expand Up @@ -1956,7 +1958,7 @@
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
config = configure

Check failure on line 1961 in stdlib/tkinter/__init__.pyi

View workflow job for this annotation

GitHub Actions / Test typeshed with pyright (Linux, 3.12)

Type "Overload[(self: Self@Entry, cnf: dict[str, Any] | None = None, *, background: str = ..., bd: _ScreenUnits = ..., bg: str = ..., border: _ScreenUnits = ..., borderwidth: _ScreenUnits = ..., cursor: _Cursor = ..., disabledbackground: str = ..., disabledforeground: str = ..., exportselection: bool = ..., fg: str = ..., font: _FontDescription = ..., foreground: str = ..., highlightbackground: str = ..., highlightcolor: str = ..., highlightthickness: _ScreenUnits = ..., insertbackground: str = ..., insertborderwidth: _ScreenUnits = ..., insertofftime: int = ..., insertontime: int = ..., insertwidth: _ScreenUnits = ..., invalidcommand: _EntryValidateCommand = ..., invcmd: _EntryValidateCommand = ..., justify: Literal['left', 'center', 'right'] = ..., readonlybackground: str = ..., relief: _Relief = ..., selectbackground: str = ..., selectborderwidth: _ScreenUnits = ..., selectforeground: str = ..., show: str = ..., state: Literal['normal', 'disabled', 'readonly'] = ..., takefocus: _TakeFocusValue = ..., textvariable: Variable = ..., validate: Literal['none', 'focus', 'focusin', 'focusout', 'key', 'all'] = ..., validatecommand: _EntryValidateCommand = ..., vcmd: _EntryValidateCommand = ..., width: int = ..., xscrollcommand: _XYScrollCommand = ...) -> (dict[str, tuple[str, str, str, Any, Any]] | None), (self: Self@Entry, cnf: str) -> tuple[str, str, str, Any, Any]]" is not assignable to declared type "(self: Self@Form, cnf: dict[str, Any] = {}, **kw: Unknown) -> None"   No overloaded function matches type "(self: Self@Form, cnf: dict[str, Any] = {}, **kw: Unknown) -> None" (reportAssignmentType)
def delete(self, first: str | int, last: str | int | None = None) -> None: ...
def get(self) -> str: ...
def icursor(self, index: str | int) -> None: ...
Expand Down Expand Up @@ -2027,7 +2029,7 @@
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
config = configure

Check failure on line 2032 in stdlib/tkinter/__init__.pyi

View workflow job for this annotation

GitHub Actions / Test typeshed with pyright (Linux, 3.12)

Type "Overload[(self: Self@Frame, cnf: dict[str, Any] | None = None, *, background: str = ..., bd: _ScreenUnits = ..., bg: str = ..., border: _ScreenUnits = ..., borderwidth: _ScreenUnits = ..., cursor: _Cursor = ..., height: _ScreenUnits = ..., highlightbackground: str = ..., highlightcolor: str = ..., highlightthickness: _ScreenUnits = ..., padx: _ScreenUnits = ..., pady: _ScreenUnits = ..., relief: _Relief = ..., takefocus: _TakeFocusValue = ..., width: _ScreenUnits = ...) -> (dict[str, tuple[str, str, str, Any, Any]] | None), (self: Self@Frame, cnf: str) -> tuple[str, str, str, Any, Any]]" is not assignable to declared type "(self: Self@Form, cnf: dict[str, Any] = {}, **kw: Unknown) -> None"   No overloaded function matches type "(self: Self@Form, cnf: dict[str, Any] = {}, **kw: Unknown) -> None" (reportAssignmentType)

class Label(Widget):
def __init__(
Expand Down Expand Up @@ -2107,7 +2109,7 @@
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
config = configure

Check failure on line 2112 in stdlib/tkinter/__init__.pyi

View workflow job for this annotation

GitHub Actions / Test typeshed with pyright (Linux, 3.12)

Type "Overload[(self: Self@Label, cnf: dict[str, Any] | None = None, *, activebackground: str = ..., activeforeground: str = ..., anchor: _Anchor = ..., background: str = ..., bd: _ScreenUnits = ..., bg: str = ..., bitmap: str = ..., border: _ScreenUnits = ..., borderwidth: _ScreenUnits = ..., compound: _Compound = ..., cursor: _Cursor = ..., disabledforeground: str = ..., fg: str = ..., font: _FontDescription = ..., foreground: str = ..., height: _ScreenUnits = ..., highlightbackground: str = ..., highlightcolor: str = ..., highlightthickness: _ScreenUnits = ..., image: _ImageSpec = ..., justify: Literal['left', 'center', 'right'] = ..., padx: _ScreenUnits = ..., pady: _ScreenUnits = ..., relief: _Relief = ..., state: Literal['normal', 'active', 'disabled'] = ..., takefocus: _TakeFocusValue = ..., text: float | str = ..., textvariable: Variable = ..., underline: int = ..., width: _ScreenUnits = ..., wraplength: _ScreenUnits = ...) -> (dict[str, tuple[str, str, str, Any, Any]] | None), (self: Self@Label, cnf: str) -> tuple[str, str, str, Any, Any]]" is not assignable to declared type "(self: Self@Form, cnf: dict[str, Any] = {}, **kw: Unknown) -> None"   No overloaded function matches type "(self: Self@Form, cnf: dict[str, Any] = {}, **kw: Unknown) -> None" (reportAssignmentType)

class Listbox(Widget, XView, YView):
def __init__(
Expand Down Expand Up @@ -2198,7 +2200,7 @@
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
config = configure

Check failure on line 2203 in stdlib/tkinter/__init__.pyi

View workflow job for this annotation

GitHub Actions / Test typeshed with pyright (Linux, 3.12)

Type "Overload[(self: Self@Listbox, cnf: dict[str, Any] | None = None, *, activestyle: Literal['dotbox', 'none', 'underline'] = ..., background: str = ..., bd: _ScreenUnits = ..., bg: str = ..., border: _ScreenUnits = ..., borderwidth: _ScreenUnits = ..., cursor: _Cursor = ..., disabledforeground: str = ..., exportselection: bool = ..., fg: str = ..., font: _FontDescription = ..., foreground: str = ..., height: int = ..., highlightbackground: str = ..., highlightcolor: str = ..., highlightthickness: _ScreenUnits = ..., justify: Literal['left', 'center', 'right'] = ..., listvariable: Variable = ..., relief: _Relief = ..., selectbackground: str = ..., selectborderwidth: _ScreenUnits = ..., selectforeground: str = ..., selectmode: str | Literal['single', 'browse', 'multiple', 'extended'] = ..., setgrid: bool = ..., state: Literal['normal', 'disabled'] = ..., takefocus: _TakeFocusValue = ..., width: int = ..., xscrollcommand: _XYScrollCommand = ..., yscrollcommand: _XYScrollCommand = ...) -> (dict[str, tuple[str, str, str, Any, Any]] | None), (self: Self@Listbox, cnf: str) -> tuple[str, str, str, Any, Any]]" is not assignable to declared type "(self: Self@Form, cnf: dict[str, Any] = {}, **kw: Unknown) -> None"   No overloaded function matches type "(self: Self@Form, cnf: dict[str, Any] = {}, **kw: Unknown) -> None" (reportAssignmentType)
def activate(self, index: str | int) -> None: ...
def bbox(self, index: str | int) -> tuple[int, int, int, int] | None: ... # type: ignore[override]
def curselection(self): ...
Expand Down Expand Up @@ -2284,7 +2286,7 @@
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
config = configure

Check failure on line 2289 in stdlib/tkinter/__init__.pyi

View workflow job for this annotation

GitHub Actions / Test typeshed with pyright (Linux, 3.12)

Type "Overload[(self: Self@Menu, cnf: dict[str, Any] | None = None, *, activebackground: str = ..., activeborderwidth: _ScreenUnits = ..., activeforeground: str = ..., background: str = ..., bd: _ScreenUnits = ..., bg: str = ..., border: _ScreenUnits = ..., borderwidth: _ScreenUnits = ..., cursor: _Cursor = ..., disabledforeground: str = ..., fg: str = ..., font: _FontDescription = ..., foreground: str = ..., postcommand: (() -> object) | str = ..., relief: _Relief = ..., selectcolor: str = ..., takefocus: _TakeFocusValue = ..., tearoff: bool = ..., tearoffcommand: ((str, str) -> object) | str = ..., title: str = ..., type: Literal['menubar', 'tearoff', 'normal'] = ...) -> (dict[str, tuple[str, str, str, Any, Any]] | None), (self: Self@Menu, cnf: str) -> tuple[str, str, str, Any, Any]]" is not assignable to declared type "(self: Self@Form, cnf: dict[str, Any] = {}, **kw: Unknown) -> None"   No overloaded function matches type "(self: Self@Form, cnf: dict[str, Any] = {}, **kw: Unknown) -> None" (reportAssignmentType)
def tk_popup(self, x: int, y: int, entry: str | int = "") -> None: ...
def activate(self, index: str | int) -> None: ...
def add(self, itemType, cnf={}, **kw): ... # docstring says "Internal function."
Expand Down Expand Up @@ -2577,7 +2579,7 @@
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
config = configure

Check failure on line 2582 in stdlib/tkinter/__init__.pyi

View workflow job for this annotation

GitHub Actions / Test typeshed with pyright (Linux, 3.12)

Type "Overload[(self: Self@Menubutton, cnf: dict[str, Any] | None = None, *, activebackground: str = ..., activeforeground: str = ..., anchor: _Anchor = ..., background: str = ..., bd: _ScreenUnits = ..., bg: str = ..., bitmap: str = ..., border: _ScreenUnits = ..., borderwidth: _ScreenUnits = ..., compound: _Compound = ..., cursor: _Cursor = ..., direction: Literal['above', 'below', 'left', 'right', 'flush'] = ..., disabledforeground: str = ..., fg: str = ..., font: _FontDescription = ..., foreground: str = ..., height: _ScreenUnits = ..., highlightbackground: str = ..., highlightcolor: str = ..., highlightthickness: _ScreenUnits = ..., image: _ImageSpec = ..., indicatoron: bool = ..., justify: Literal['left', 'center', 'right'] = ..., menu: Menu = ..., padx: _ScreenUnits = ..., pady: _ScreenUnits = ..., relief: _Relief = ..., state: Literal['normal', 'active', 'disabled'] = ..., takefocus: _TakeFocusValue = ..., text: float | str = ..., textvariable: Variable = ..., underline: int = ..., width: _ScreenUnits = ..., wraplength: _ScreenUnits = ...) -> (dict[str, tuple[str, str, str, Any, Any]] | None), (self: Self@Menubutton, cnf: str) -> tuple[str, str, str, Any, Any]]" is not assignable to declared type "(self: Self@Form, cnf: dict[str, Any] = {}, **kw: Unknown) -> None"   No overloaded function matches type "(self: Self@Form, cnf: dict[str, Any] = {}, **kw: Unknown) -> None" (reportAssignmentType)

class Message(Widget):
def __init__(
Expand Down Expand Up @@ -2640,7 +2642,7 @@
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
config = configure

Check failure on line 2645 in stdlib/tkinter/__init__.pyi

View workflow job for this annotation

GitHub Actions / Test typeshed with pyright (Linux, 3.12)

Type "Overload[(self: Self@Message, cnf: dict[str, Any] | None = None, *, anchor: _Anchor = ..., aspect: int = ..., background: str = ..., bd: _ScreenUnits = ..., bg: str = ..., border: _ScreenUnits = ..., borderwidth: _ScreenUnits = ..., cursor: _Cursor = ..., fg: str = ..., font: _FontDescription = ..., foreground: str = ..., highlightbackground: str = ..., highlightcolor: str = ..., highlightthickness: _ScreenUnits = ..., justify: Literal['left', 'center', 'right'] = ..., padx: _ScreenUnits = ..., pady: _ScreenUnits = ..., relief: _Relief = ..., takefocus: _TakeFocusValue = ..., text: float | str = ..., textvariable: Variable = ..., width: _ScreenUnits = ...) -> (dict[str, tuple[str, str, str, Any, Any]] | None), (self: Self@Message, cnf: str) -> tuple[str, str, str, Any, Any]]" is not assignable to declared type "(self: Self@Form, cnf: dict[str, Any] = {}, **kw: Unknown) -> None"   No overloaded function matches type "(self: Self@Form, cnf: dict[str, Any] = {}, **kw: Unknown) -> None" (reportAssignmentType)

class Radiobutton(Widget):
def __init__(
Expand Down
Loading