Skip to content

Commit ec184fe

Browse files
authored
[tkinter] Remove _TtkCompound alias (#14794)
1 parent fb21402 commit ec184fe

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

stdlib/tkinter/ttk.pyi

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ _Padding: TypeAlias = (
4747
| tuple[float | str, float | str, float | str, float | str]
4848
)
4949

50-
# from ttk_widget (aka ttk::widget) manual page, differs from compound
51-
_TtkCompound: TypeAlias = Literal["", "text", "image", "top", "left", "center", "right", "bottom", "none"]
52-
5350
# Last item (option value to apply) varies between different options so use Any.
5451
# It could also be any iterable with items matching the tuple, but that case
5552
# hasn't been added here for consistency with _Padding above.
@@ -216,7 +213,7 @@ class Button(Widget):
216213
*,
217214
class_: str = "",
218215
command: str | Callable[[], Any] = "",
219-
compound: _TtkCompound = "",
216+
compound: Literal["", "text", "image", "top", "left", "center", "right", "bottom", "none"] = "",
220217
cursor: tkinter._Cursor = "",
221218
default: Literal["normal", "active", "disabled"] = "normal",
222219
image: tkinter._Image | str = "",
@@ -236,7 +233,7 @@ class Button(Widget):
236233
cnf: dict[str, Any] | None = None,
237234
*,
238235
command: str | Callable[[], Any] = ...,
239-
compound: _TtkCompound = ...,
236+
compound: Literal["", "text", "image", "top", "left", "center", "right", "bottom", "none"] = ...,
240237
cursor: tkinter._Cursor = ...,
241238
default: Literal["normal", "active", "disabled"] = ...,
242239
image: tkinter._Image | str = ...,
@@ -261,7 +258,7 @@ class Checkbutton(Widget):
261258
*,
262259
class_: str = "",
263260
command: str | Callable[[], Any] = "",
264-
compound: _TtkCompound = "",
261+
compound: Literal["", "text", "image", "top", "left", "center", "right", "bottom", "none"] = "",
265262
cursor: tkinter._Cursor = "",
266263
image: tkinter._Image | str = "",
267264
name: str = ...,
@@ -286,7 +283,7 @@ class Checkbutton(Widget):
286283
cnf: dict[str, Any] | None = None,
287284
*,
288285
command: str | Callable[[], Any] = ...,
289-
compound: _TtkCompound = ...,
286+
compound: Literal["", "text", "image", "top", "left", "center", "right", "bottom", "none"] = ...,
290287
cursor: tkinter._Cursor = ...,
291288
image: tkinter._Image | str = ...,
292289
offvalue: Any = ...,
@@ -517,7 +514,7 @@ class Label(Widget):
517514
border: float | str = ..., # alias for borderwidth
518515
borderwidth: float | str = ..., # undocumented
519516
class_: str = "",
520-
compound: _TtkCompound = "",
517+
compound: Literal["", "text", "image", "top", "left", "center", "right", "bottom", "none"] = "",
521518
cursor: tkinter._Cursor = "",
522519
font: _FontDescription = ...,
523520
foreground: str = "",
@@ -544,7 +541,7 @@ class Label(Widget):
544541
background: str = ...,
545542
border: float | str = ...,
546543
borderwidth: float | str = ...,
547-
compound: _TtkCompound = ...,
544+
compound: Literal["", "text", "image", "top", "left", "center", "right", "bottom", "none"] = ...,
548545
cursor: tkinter._Cursor = ...,
549546
font: _FontDescription = ...,
550547
foreground: str = ...,
@@ -617,7 +614,7 @@ class Menubutton(Widget):
617614
master: tkinter.Misc | None = None,
618615
*,
619616
class_: str = "",
620-
compound: _TtkCompound = "",
617+
compound: Literal["", "text", "image", "top", "left", "center", "right", "bottom", "none"] = "",
621618
cursor: tkinter._Cursor = "",
622619
direction: Literal["above", "below", "left", "right", "flush"] = "below",
623620
image: tkinter._Image | str = "",
@@ -637,7 +634,7 @@ class Menubutton(Widget):
637634
self,
638635
cnf: dict[str, Any] | None = None,
639636
*,
640-
compound: _TtkCompound = ...,
637+
compound: Literal["", "text", "image", "top", "left", "center", "right", "bottom", "none"] = ...,
641638
cursor: tkinter._Cursor = ...,
642639
direction: Literal["above", "below", "left", "right", "flush"] = ...,
643640
image: tkinter._Image | str = ...,
@@ -806,7 +803,7 @@ class Radiobutton(Widget):
806803
*,
807804
class_: str = "",
808805
command: str | Callable[[], Any] = "",
809-
compound: _TtkCompound = "",
806+
compound: Literal["", "text", "image", "top", "left", "center", "right", "bottom", "none"] = "",
810807
cursor: tkinter._Cursor = "",
811808
image: tkinter._Image | str = "",
812809
name: str = ...,
@@ -827,7 +824,7 @@ class Radiobutton(Widget):
827824
cnf: dict[str, Any] | None = None,
828825
*,
829826
command: str | Callable[[], Any] = ...,
830-
compound: _TtkCompound = ...,
827+
compound: Literal["", "text", "image", "top", "left", "center", "right", "bottom", "none"] = ...,
831828
cursor: tkinter._Cursor = ...,
832829
image: tkinter._Image | str = ...,
833830
padding=...,

0 commit comments

Comments
 (0)