Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion stdlib/3/tkinter/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ class Tk(Misc, Wm):
) -> None: ...
@overload
def configure(
self,
self: Union[Tk, Toplevel],
cnf: Optional[Dict[str, Any]] = ...,
*,
background: _Color = ...,
Expand Down
106 changes: 101 additions & 5 deletions stdlib/3/tkinter/ttk.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,31 @@ class Entry(Widget, tkinter.Entry):
) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ...
@overload
def configure(self, cnf: _EntryOptionName) -> Tuple[str, str, str, Any, Any]: ...
config = configure # type: ignore
# config must be copy/pasted, otherwise ttk.Entry().config is mypy error (don't know why)
@overload # type: ignore
def config(
self,
cnf: Optional[Dict[str, Any]] = ...,
*,
background: tkinter._Color = ...,
cursor: tkinter._Cursor = ...,
exportselection: bool = ...,
font: _FontDescription = ...,
foreground: tkinter._Color = ...,
invalidcommand: tkinter._EntryValidateCommand = ...,
justify: Literal["left", "center", "right"] = ...,
show: str = ...,
state: Literal["normal", "disabled", "readonly"] = ...,
style: str = ...,
takefocus: tkinter._TakeFocusValue = ...,
textvariable: tkinter.Variable = ...,
validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ...,
validatecommand: tkinter._EntryValidateCommand = ...,
width: int = ...,
xscrollcommand: tkinter._XYScrollCommand = ...,
) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ...
@overload
def config(self, cnf: _EntryOptionName) -> Tuple[str, str, str, Any, Any]: ...
def cget(self, key: _EntryOptionName) -> Any: ... # type: ignore
def bbox(self, index): ...
def identify(self, x, y): ...
Expand Down Expand Up @@ -316,7 +340,34 @@ class Combobox(Entry):
) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ...
@overload
def configure(self, cnf: _ComboboxOptionName) -> Tuple[str, str, str, Any, Any]: ...
config = configure # type: ignore
# config must be copy/pasted, otherwise ttk.Combobox().config is mypy error (don't know why)
@overload # type: ignore
def config(
self,
cnf: Optional[Dict[str, Any]] = ...,
*,
background: tkinter._Color = ...,
cursor: tkinter._Cursor = ...,
exportselection: bool = ...,
font: _FontDescription = ...,
foreground: tkinter._Color = ...,
height: int = ...,
invalidcommand: tkinter._EntryValidateCommand = ...,
justify: Literal["left", "center", "right"] = ...,
postcommand: Union[Callable[[], None], str] = ...,
show: Any = ...,
state: Literal["normal", "readonly", "disabled"] = ...,
style: str = ...,
takefocus: tkinter._TakeFocusValue = ...,
textvariable: tkinter.Variable = ...,
validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ...,
validatecommand: tkinter._EntryValidateCommand = ...,
values: tkinter._TkinterSequence[str] = ...,
width: int = ...,
xscrollcommand: tkinter._XYScrollCommand = ...,
) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ...
@overload
def config(self, cnf: _ComboboxOptionName) -> Tuple[str, str, str, Any, Any]: ...
def cget(self, key: _ComboboxOptionName) -> Any: ... # type: ignore
def current(self, newindex: Optional[Any] = ...): ...
def set(self, value): ...
Expand Down Expand Up @@ -638,7 +689,20 @@ class Panedwindow(Widget, tkinter.PanedWindow):
) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ...
@overload
def configure(self, cnf: _PanedwindowOptionName) -> Tuple[str, str, str, Any, Any]: ...
config = configure # type: ignore
# config must be copy/pasted, otherwise ttk.Panedwindow().config is mypy error (don't know why)
@overload # type: ignore
def config(
self,
cnf: Optional[Dict[str, Any]] = ...,
*,
cursor: tkinter._Cursor = ...,
height: int = ...,
style: str = ...,
takefocus: tkinter._TakeFocusValue = ...,
width: int = ...,
) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ...
@overload
def config(self, cnf: _PanedwindowOptionName) -> Tuple[str, str, str, Any, Any]: ...
def cget(self, key: _PanedwindowOptionName) -> Any: ... # type: ignore
forget: Any
def insert(self, pos, child, **kw): ...
Expand Down Expand Up @@ -798,7 +862,26 @@ class Scale(Widget, tkinter.Scale):
) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ...
@overload
def configure(self, cnf: _ScaleOptionName) -> Tuple[str, str, str, Any, Any]: ...
config = configure # type: ignore
# config must be copy/pasted, otherwise ttk.Scale().config is mypy error (don't know why)
@overload # type: ignore
def config(
self,
cnf: Optional[Dict[str, Any]] = ...,
*,
command: Union[str, Callable[[str], None]] = ...,
cursor: tkinter._Cursor = ...,
from_: float = ...,
length: tkinter._ScreenUnits = ...,
orient: Literal["horizontal", "vertical"] = ...,
state: Any = ...,
style: str = ...,
takefocus: tkinter._TakeFocusValue = ...,
to: float = ...,
value: float = ...,
variable: tkinter.DoubleVar = ...,
) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ...
@overload
def config(self, cnf: _ScaleOptionName) -> Tuple[str, str, str, Any, Any]: ...
def cget(self, key: _ScaleOptionName) -> Any: ... # type: ignore
def get(self, x: Optional[Any] = ..., y: Optional[Any] = ...): ...

Expand Down Expand Up @@ -829,7 +912,20 @@ class Scrollbar(Widget, tkinter.Scrollbar):
) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ...
@overload
def configure(self, cnf: _ScrollbarOptionName) -> Tuple[str, str, str, Any, Any]: ...
config = configure # type: ignore
# config must be copy/pasted, otherwise ttk.Scrollbar().config is mypy error (don't know why)
@overload # type: ignore
def config(
self,
cnf: Optional[Dict[str, Any]] = ...,
*,
command: Union[Callable[..., Optional[Tuple[float, float]]], str] = ...,
cursor: tkinter._Cursor = ...,
orient: Literal["horizontal", "vertical"] = ...,
style: str = ...,
takefocus: tkinter._TakeFocusValue = ...,
) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ...
@overload
def config(self, cnf: _ScrollbarOptionName) -> Tuple[str, str, str, Any, Any]: ...
def cget(self, key: _ScrollbarOptionName) -> Any: ... # type: ignore

_SeparatorOptionName = Literal["class", "cursor", "orient", "style", "takefocus"]
Expand Down