Skip to content
Merged
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
23 changes: 10 additions & 13 deletions stdlib/tkinter/ttk.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ _Padding: TypeAlias = (
| tuple[float | str, float | str, float | str, float | str]
)

# from ttk_widget (aka ttk::widget) manual page, differs from compound
_TtkCompound: TypeAlias = Literal["", "text", "image", "top", "left", "center", "right", "bottom", "none"]

# Last item (option value to apply) varies between different options so use Any.
# It could also be any iterable with items matching the tuple, but that case
# hasn't been added here for consistency with _Padding above.
Expand Down Expand Up @@ -216,7 +213,7 @@ class Button(Widget):
*,
class_: str = "",
command: str | Callable[[], Any] = "",
compound: _TtkCompound = "",
compound: Literal["", "text", "image", "top", "left", "center", "right", "bottom", "none"] = "",
cursor: tkinter._Cursor = "",
default: Literal["normal", "active", "disabled"] = "normal",
image: tkinter._Image | str = "",
Expand All @@ -236,7 +233,7 @@ class Button(Widget):
cnf: dict[str, Any] | None = None,
*,
command: str | Callable[[], Any] = ...,
compound: _TtkCompound = ...,
compound: Literal["", "text", "image", "top", "left", "center", "right", "bottom", "none"] = ...,
cursor: tkinter._Cursor = ...,
default: Literal["normal", "active", "disabled"] = ...,
image: tkinter._Image | str = ...,
Expand All @@ -261,7 +258,7 @@ class Checkbutton(Widget):
*,
class_: str = "",
command: str | Callable[[], Any] = "",
compound: _TtkCompound = "",
compound: Literal["", "text", "image", "top", "left", "center", "right", "bottom", "none"] = "",
cursor: tkinter._Cursor = "",
image: tkinter._Image | str = "",
name: str = ...,
Expand All @@ -286,7 +283,7 @@ class Checkbutton(Widget):
cnf: dict[str, Any] | None = None,
*,
command: str | Callable[[], Any] = ...,
compound: _TtkCompound = ...,
compound: Literal["", "text", "image", "top", "left", "center", "right", "bottom", "none"] = ...,
cursor: tkinter._Cursor = ...,
image: tkinter._Image | str = ...,
offvalue: Any = ...,
Expand Down Expand Up @@ -517,7 +514,7 @@ class Label(Widget):
border: float | str = ..., # alias for borderwidth
borderwidth: float | str = ..., # undocumented
class_: str = "",
compound: _TtkCompound = "",
compound: Literal["", "text", "image", "top", "left", "center", "right", "bottom", "none"] = "",
cursor: tkinter._Cursor = "",
font: _FontDescription = ...,
foreground: str = "",
Expand All @@ -544,7 +541,7 @@ class Label(Widget):
background: str = ...,
border: float | str = ...,
borderwidth: float | str = ...,
compound: _TtkCompound = ...,
compound: Literal["", "text", "image", "top", "left", "center", "right", "bottom", "none"] = ...,
cursor: tkinter._Cursor = ...,
font: _FontDescription = ...,
foreground: str = ...,
Expand Down Expand Up @@ -617,7 +614,7 @@ class Menubutton(Widget):
master: tkinter.Misc | None = None,
*,
class_: str = "",
compound: _TtkCompound = "",
compound: Literal["", "text", "image", "top", "left", "center", "right", "bottom", "none"] = "",
cursor: tkinter._Cursor = "",
direction: Literal["above", "below", "left", "right", "flush"] = "below",
image: tkinter._Image | str = "",
Expand All @@ -637,7 +634,7 @@ class Menubutton(Widget):
self,
cnf: dict[str, Any] | None = None,
*,
compound: _TtkCompound = ...,
compound: Literal["", "text", "image", "top", "left", "center", "right", "bottom", "none"] = ...,
cursor: tkinter._Cursor = ...,
direction: Literal["above", "below", "left", "right", "flush"] = ...,
image: tkinter._Image | str = ...,
Expand Down Expand Up @@ -806,7 +803,7 @@ class Radiobutton(Widget):
*,
class_: str = "",
command: str | Callable[[], Any] = "",
compound: _TtkCompound = "",
compound: Literal["", "text", "image", "top", "left", "center", "right", "bottom", "none"] = "",
cursor: tkinter._Cursor = "",
image: tkinter._Image | str = "",
name: str = ...,
Expand All @@ -827,7 +824,7 @@ class Radiobutton(Widget):
cnf: dict[str, Any] | None = None,
*,
command: str | Callable[[], Any] = ...,
compound: _TtkCompound = ...,
compound: Literal["", "text", "image", "top", "left", "center", "right", "bottom", "none"] = ...,
cursor: tkinter._Cursor = ...,
image: tkinter._Image | str = ...,
padding=...,
Expand Down
Loading