massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stdlib / tkinter / ttk.pyi
1 import _tkinter
2 import sys
3 import tkinter
4 from tkinter.font import _FontDescription
5 from typing import Any, Callable, Tuple, Union, overload
6 from typing_extensions import Literal, TypedDict
7
8 def tclobjs_to_py(adict): ...
9 def setup_master(master: Any | None = ...): ...
10
11 # from ttk_widget (aka ttk::widget) manual page, differs from tkinter._Compound
12 _TtkCompound = Literal["text", "image", tkinter._Compound]
13
14 class Style:
15     master: Any
16     tk: _tkinter.TkappType
17     def __init__(self, master: tkinter.Misc | None = ...): ...
18     def configure(self, style, query_opt: Any | None = ..., **kw): ...
19     def map(self, style, query_opt: Any | None = ..., **kw): ...
20     def lookup(self, style, option, state: Any | None = ..., default: Any | None = ...): ...
21     def layout(self, style, layoutspec: Any | None = ...): ...
22     def element_create(self, elementname, etype, *args, **kw): ...
23     def element_names(self): ...
24     def element_options(self, elementname): ...
25     def theme_create(self, themename, parent: Any | None = ..., settings: Any | None = ...): ...
26     def theme_settings(self, themename, settings): ...
27     def theme_names(self) -> Tuple[str, ...]: ...
28     @overload
29     def theme_use(self, themename: str) -> None: ...
30     @overload
31     def theme_use(self, themename: None = ...) -> str: ...
32
33 class Widget(tkinter.Widget):
34     def __init__(self, master: tkinter.Misc | None, widgetname, kw: Any | None = ...): ...
35     def identify(self, x, y): ...
36     def instate(self, statespec, callback: Any | None = ..., *args, **kw): ...
37     def state(self, statespec: Any | None = ...): ...
38
39 class Button(Widget):
40     def __init__(
41         self,
42         master: tkinter.Misc | None = ...,
43         *,
44         class_: str = ...,
45         command: tkinter._ButtonCommand = ...,
46         compound: _TtkCompound = ...,
47         cursor: tkinter._Cursor = ...,
48         default: Literal["normal", "active", "disabled"] = ...,
49         image: tkinter._ImageSpec = ...,
50         name: str = ...,
51         padding: Any = ...,  # undocumented
52         state: str = ...,
53         style: str = ...,
54         takefocus: tkinter._TakeFocusValue = ...,
55         text: float | str = ...,
56         textvariable: tkinter.Variable = ...,
57         underline: int = ...,
58         width: int | Literal[""] = ...,
59     ) -> None: ...
60     @overload
61     def configure(
62         self,
63         cnf: dict[str, Any] | None = ...,
64         *,
65         command: tkinter._ButtonCommand = ...,
66         compound: _TtkCompound = ...,
67         cursor: tkinter._Cursor = ...,
68         default: Literal["normal", "active", "disabled"] = ...,
69         image: tkinter._ImageSpec = ...,
70         padding: Any = ...,
71         state: str = ...,
72         style: str = ...,
73         takefocus: tkinter._TakeFocusValue = ...,
74         text: float | str = ...,
75         textvariable: tkinter.Variable = ...,
76         underline: int = ...,
77         width: int | Literal[""] = ...,
78     ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
79     @overload
80     def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
81     config = configure
82     def invoke(self) -> Any: ...
83
84 class Checkbutton(Widget):
85     def __init__(
86         self,
87         master: tkinter.Misc | None = ...,
88         *,
89         class_: str = ...,
90         command: tkinter._ButtonCommand = ...,
91         compound: _TtkCompound = ...,
92         cursor: tkinter._Cursor = ...,
93         image: tkinter._ImageSpec = ...,
94         name: str = ...,
95         offvalue: Any = ...,
96         onvalue: Any = ...,
97         padding: Any = ...,  # undocumented
98         state: str = ...,
99         style: str = ...,
100         takefocus: tkinter._TakeFocusValue = ...,
101         text: float | str = ...,
102         textvariable: tkinter.Variable = ...,
103         underline: int = ...,
104         # Seems like variable can be empty string, but actually setting it to
105         # empty string segfaults before Tcl 8.6.9. Search for ttk::checkbutton
106         # here: https://sourceforge.net/projects/tcl/files/Tcl/8.6.9/tcltk-release-notes-8.6.9.txt/view
107         variable: tkinter.Variable = ...,
108         width: int | Literal[""] = ...,
109     ) -> None: ...
110     @overload
111     def configure(
112         self,
113         cnf: dict[str, Any] | None = ...,
114         *,
115         command: tkinter._ButtonCommand = ...,
116         compound: _TtkCompound = ...,
117         cursor: tkinter._Cursor = ...,
118         image: tkinter._ImageSpec = ...,
119         offvalue: Any = ...,
120         onvalue: Any = ...,
121         padding: Any = ...,
122         state: str = ...,
123         style: str = ...,
124         takefocus: tkinter._TakeFocusValue = ...,
125         text: float | str = ...,
126         textvariable: tkinter.Variable = ...,
127         underline: int = ...,
128         variable: tkinter.Variable = ...,
129         width: int | Literal[""] = ...,
130     ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
131     @overload
132     def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
133     config = configure
134     def invoke(self) -> Any: ...
135
136 class Entry(Widget, tkinter.Entry):
137     def __init__(
138         self,
139         master: tkinter.Misc | None = ...,
140         widget: str | None = ...,
141         *,
142         background: tkinter._Color = ...,  # undocumented
143         class_: str = ...,
144         cursor: tkinter._Cursor = ...,
145         exportselection: bool = ...,
146         font: _FontDescription = ...,
147         foreground: tkinter._Color = ...,
148         invalidcommand: tkinter._EntryValidateCommand = ...,
149         justify: Literal["left", "center", "right"] = ...,
150         name: str = ...,
151         show: str = ...,
152         state: str = ...,
153         style: str = ...,
154         takefocus: tkinter._TakeFocusValue = ...,
155         textvariable: tkinter.Variable = ...,
156         validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ...,
157         validatecommand: tkinter._EntryValidateCommand = ...,
158         width: int = ...,
159         xscrollcommand: tkinter._XYScrollCommand = ...,
160     ) -> None: ...
161     @overload  # type: ignore
162     def configure(
163         self,
164         cnf: dict[str, Any] | None = ...,
165         *,
166         background: tkinter._Color = ...,
167         cursor: tkinter._Cursor = ...,
168         exportselection: bool = ...,
169         font: _FontDescription = ...,
170         foreground: tkinter._Color = ...,
171         invalidcommand: tkinter._EntryValidateCommand = ...,
172         justify: Literal["left", "center", "right"] = ...,
173         show: str = ...,
174         state: str = ...,
175         style: str = ...,
176         takefocus: tkinter._TakeFocusValue = ...,
177         textvariable: tkinter.Variable = ...,
178         validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ...,
179         validatecommand: tkinter._EntryValidateCommand = ...,
180         width: int = ...,
181         xscrollcommand: tkinter._XYScrollCommand = ...,
182     ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
183     @overload
184     def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
185     # config must be copy/pasted, otherwise ttk.Entry().config is mypy error (don't know why)
186     @overload  # type: ignore
187     def config(
188         self,
189         cnf: dict[str, Any] | None = ...,
190         *,
191         background: tkinter._Color = ...,
192         cursor: tkinter._Cursor = ...,
193         exportselection: bool = ...,
194         font: _FontDescription = ...,
195         foreground: tkinter._Color = ...,
196         invalidcommand: tkinter._EntryValidateCommand = ...,
197         justify: Literal["left", "center", "right"] = ...,
198         show: str = ...,
199         state: str = ...,
200         style: str = ...,
201         takefocus: tkinter._TakeFocusValue = ...,
202         textvariable: tkinter.Variable = ...,
203         validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ...,
204         validatecommand: tkinter._EntryValidateCommand = ...,
205         width: int = ...,
206         xscrollcommand: tkinter._XYScrollCommand = ...,
207     ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
208     @overload
209     def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
210     def bbox(self, index): ...
211     def identify(self, x, y): ...
212     def validate(self): ...
213
214 class Combobox(Entry):
215     def __init__(
216         self,
217         master: tkinter.Misc | None = ...,
218         *,
219         background: tkinter._Color = ...,  # undocumented
220         class_: str = ...,
221         cursor: tkinter._Cursor = ...,
222         exportselection: bool = ...,
223         font: _FontDescription = ...,  # undocumented
224         foreground: tkinter._Color = ...,  # undocumented
225         height: int = ...,
226         invalidcommand: tkinter._EntryValidateCommand = ...,  # undocumented
227         justify: Literal["left", "center", "right"] = ...,
228         name: str = ...,
229         postcommand: Callable[[], Any] | str = ...,
230         show: Any = ...,  # undocumented
231         state: str = ...,
232         style: str = ...,
233         takefocus: tkinter._TakeFocusValue = ...,
234         textvariable: tkinter.Variable = ...,
235         validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ...,  # undocumented
236         validatecommand: tkinter._EntryValidateCommand = ...,  # undocumented
237         values: list[str] | Tuple[str, ...] = ...,
238         width: int = ...,
239         xscrollcommand: tkinter._XYScrollCommand = ...,  # undocumented
240     ) -> None: ...
241     @overload  # type: ignore
242     def configure(
243         self,
244         cnf: dict[str, Any] | None = ...,
245         *,
246         background: tkinter._Color = ...,
247         cursor: tkinter._Cursor = ...,
248         exportselection: bool = ...,
249         font: _FontDescription = ...,
250         foreground: tkinter._Color = ...,
251         height: int = ...,
252         invalidcommand: tkinter._EntryValidateCommand = ...,
253         justify: Literal["left", "center", "right"] = ...,
254         postcommand: Callable[[], Any] | str = ...,
255         show: Any = ...,
256         state: str = ...,
257         style: str = ...,
258         takefocus: tkinter._TakeFocusValue = ...,
259         textvariable: tkinter.Variable = ...,
260         validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ...,
261         validatecommand: tkinter._EntryValidateCommand = ...,
262         values: list[str] | Tuple[str, ...] = ...,
263         width: int = ...,
264         xscrollcommand: tkinter._XYScrollCommand = ...,
265     ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
266     @overload
267     def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
268     # config must be copy/pasted, otherwise ttk.Combobox().config is mypy error (don't know why)
269     @overload  # type: ignore
270     def config(
271         self,
272         cnf: dict[str, Any] | None = ...,
273         *,
274         background: tkinter._Color = ...,
275         cursor: tkinter._Cursor = ...,
276         exportselection: bool = ...,
277         font: _FontDescription = ...,
278         foreground: tkinter._Color = ...,
279         height: int = ...,
280         invalidcommand: tkinter._EntryValidateCommand = ...,
281         justify: Literal["left", "center", "right"] = ...,
282         postcommand: Callable[[], Any] | str = ...,
283         show: Any = ...,
284         state: str = ...,
285         style: str = ...,
286         takefocus: tkinter._TakeFocusValue = ...,
287         textvariable: tkinter.Variable = ...,
288         validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ...,
289         validatecommand: tkinter._EntryValidateCommand = ...,
290         values: list[str] | Tuple[str, ...] = ...,
291         width: int = ...,
292         xscrollcommand: tkinter._XYScrollCommand = ...,
293     ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
294     @overload
295     def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
296     def current(self, newindex: Any | None = ...): ...
297     def set(self, value): ...
298
299 class Frame(Widget):
300     def __init__(
301         self,
302         master: tkinter.Misc | None = ...,
303         *,
304         border: tkinter._ScreenUnits = ...,
305         borderwidth: tkinter._ScreenUnits = ...,
306         class_: str = ...,
307         cursor: tkinter._Cursor = ...,
308         height: tkinter._ScreenUnits = ...,
309         name: str = ...,
310         padding: tkinter._Padding = ...,
311         relief: tkinter._Relief = ...,
312         style: str = ...,
313         takefocus: tkinter._TakeFocusValue = ...,
314         width: tkinter._ScreenUnits = ...,
315     ) -> None: ...
316     @overload
317     def configure(
318         self,
319         cnf: dict[str, Any] | None = ...,
320         *,
321         border: tkinter._ScreenUnits = ...,
322         borderwidth: tkinter._ScreenUnits = ...,
323         cursor: tkinter._Cursor = ...,
324         height: tkinter._ScreenUnits = ...,
325         padding: tkinter._Padding = ...,
326         relief: tkinter._Relief = ...,
327         style: str = ...,
328         takefocus: tkinter._TakeFocusValue = ...,
329         width: tkinter._ScreenUnits = ...,
330     ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
331     @overload
332     def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
333     config = configure
334
335 class Label(Widget):
336     def __init__(
337         self,
338         master: tkinter.Misc | None = ...,
339         *,
340         anchor: tkinter._Anchor = ...,
341         background: tkinter._Color = ...,
342         border: tkinter._ScreenUnits = ...,  # alias for borderwidth
343         borderwidth: tkinter._ScreenUnits = ...,  # undocumented
344         class_: str = ...,
345         compound: _TtkCompound = ...,
346         cursor: tkinter._Cursor = ...,
347         font: _FontDescription = ...,
348         foreground: tkinter._Color = ...,
349         image: tkinter._ImageSpec = ...,
350         justify: Literal["left", "center", "right"] = ...,
351         name: str = ...,
352         padding: tkinter._Padding = ...,
353         relief: tkinter._Relief = ...,
354         state: str = ...,
355         style: str = ...,
356         takefocus: tkinter._TakeFocusValue = ...,
357         text: float | str = ...,
358         textvariable: tkinter.Variable = ...,
359         underline: int = ...,
360         width: int | Literal[""] = ...,
361         wraplength: tkinter._ScreenUnits = ...,
362     ) -> None: ...
363     @overload
364     def configure(
365         self,
366         cnf: dict[str, Any] | None = ...,
367         *,
368         anchor: tkinter._Anchor = ...,
369         background: tkinter._Color = ...,
370         border: tkinter._ScreenUnits = ...,
371         borderwidth: tkinter._ScreenUnits = ...,
372         compound: _TtkCompound = ...,
373         cursor: tkinter._Cursor = ...,
374         font: _FontDescription = ...,
375         foreground: tkinter._Color = ...,
376         image: tkinter._ImageSpec = ...,
377         justify: Literal["left", "center", "right"] = ...,
378         padding: tkinter._Padding = ...,
379         relief: tkinter._Relief = ...,
380         state: str = ...,
381         style: str = ...,
382         takefocus: tkinter._TakeFocusValue = ...,
383         text: float | str = ...,
384         textvariable: tkinter.Variable = ...,
385         underline: int = ...,
386         width: int | Literal[""] = ...,
387         wraplength: tkinter._ScreenUnits = ...,
388     ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
389     @overload
390     def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
391     config = configure
392
393 class Labelframe(Widget):
394     def __init__(
395         self,
396         master: tkinter.Misc | None = ...,
397         *,
398         border: tkinter._ScreenUnits = ...,
399         borderwidth: tkinter._ScreenUnits = ...,  # undocumented
400         class_: str = ...,
401         cursor: tkinter._Cursor = ...,
402         height: tkinter._ScreenUnits = ...,
403         labelanchor: Literal["nw", "n", "ne", "en", "e", "es", "se", "s", "sw", "ws", "w", "wn"] = ...,
404         labelwidget: tkinter.Misc = ...,
405         name: str = ...,
406         padding: tkinter._Padding = ...,
407         relief: tkinter._Relief = ...,  # undocumented
408         style: str = ...,
409         takefocus: tkinter._TakeFocusValue = ...,
410         text: float | str = ...,
411         underline: int = ...,
412         width: tkinter._ScreenUnits = ...,
413     ) -> None: ...
414     @overload
415     def configure(
416         self,
417         cnf: dict[str, Any] | None = ...,
418         *,
419         border: tkinter._ScreenUnits = ...,
420         borderwidth: tkinter._ScreenUnits = ...,
421         cursor: tkinter._Cursor = ...,
422         height: tkinter._ScreenUnits = ...,
423         labelanchor: Literal["nw", "n", "ne", "en", "e", "es", "se", "s", "sw", "ws", "w", "wn"] = ...,
424         labelwidget: tkinter.Misc = ...,
425         padding: tkinter._Padding = ...,
426         relief: tkinter._Relief = ...,
427         style: str = ...,
428         takefocus: tkinter._TakeFocusValue = ...,
429         text: float | str = ...,
430         underline: int = ...,
431         width: tkinter._ScreenUnits = ...,
432     ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
433     @overload
434     def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
435     config = configure
436
437 LabelFrame = Labelframe
438
439 class Menubutton(Widget):
440     def __init__(
441         self,
442         master: tkinter.Misc | None = ...,
443         *,
444         class_: str = ...,
445         compound: _TtkCompound = ...,
446         cursor: tkinter._Cursor = ...,
447         direction: Literal["above", "below", "left", "right", "flush"] = ...,
448         image: tkinter._ImageSpec = ...,
449         menu: tkinter.Menu = ...,
450         name: str = ...,
451         padding: Any = ...,  # undocumented
452         state: str = ...,
453         style: str = ...,
454         takefocus: tkinter._TakeFocusValue = ...,
455         text: float | str = ...,
456         textvariable: tkinter.Variable = ...,
457         underline: int = ...,
458         width: int | Literal[""] = ...,
459     ) -> None: ...
460     @overload
461     def configure(
462         self,
463         cnf: dict[str, Any] | None = ...,
464         *,
465         compound: _TtkCompound = ...,
466         cursor: tkinter._Cursor = ...,
467         direction: Literal["above", "below", "left", "right", "flush"] = ...,
468         image: tkinter._ImageSpec = ...,
469         menu: tkinter.Menu = ...,
470         padding: Any = ...,
471         state: str = ...,
472         style: str = ...,
473         takefocus: tkinter._TakeFocusValue = ...,
474         text: float | str = ...,
475         textvariable: tkinter.Variable = ...,
476         underline: int = ...,
477         width: int | Literal[""] = ...,
478     ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
479     @overload
480     def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
481     config = configure
482
483 class Notebook(Widget):
484     def __init__(
485         self,
486         master: tkinter.Misc | None = ...,
487         *,
488         class_: str = ...,
489         cursor: tkinter._Cursor = ...,
490         height: int = ...,
491         name: str = ...,
492         padding: tkinter._Padding = ...,
493         style: str = ...,
494         takefocus: tkinter._TakeFocusValue = ...,
495         width: int = ...,
496     ) -> None: ...
497     @overload
498     def configure(
499         self,
500         cnf: dict[str, Any] | None = ...,
501         *,
502         cursor: tkinter._Cursor = ...,
503         height: int = ...,
504         padding: tkinter._Padding = ...,
505         style: str = ...,
506         takefocus: tkinter._TakeFocusValue = ...,
507         width: int = ...,
508     ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
509     @overload
510     def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
511     config = configure
512     def add(
513         self,
514         child: tkinter.Widget,
515         *,
516         state: Literal["normal", "disabled", "hidden"] = ...,
517         sticky: str = ...,  # consists of letters 'n', 's', 'w', 'e', no repeats, may be empty
518         padding: tkinter._Padding = ...,
519         text: str = ...,
520         image: Any = ...,  # Sequence of an image name, followed by zero or more (sequences of one or more state names followed by an image name)
521         compound: tkinter._Compound = ...,
522         underline: int = ...,
523     ) -> None: ...
524     def forget(self, tab_id): ...
525     def hide(self, tab_id): ...
526     def identify(self, x, y): ...
527     def index(self, tab_id): ...
528     def insert(self, pos, child, **kw): ...
529     def select(self, tab_id: Any | None = ...): ...
530     def tab(self, tab_id, option: Any | None = ..., **kw): ...
531     def tabs(self): ...
532     def enable_traversal(self) -> None: ...
533
534 class Panedwindow(Widget, tkinter.PanedWindow):
535     def __init__(
536         self,
537         master: tkinter.Misc | None = ...,
538         *,
539         class_: str = ...,
540         cursor: tkinter._Cursor = ...,
541         # width and height for tkinter.ttk.Panedwindow are int but for tkinter.PanedWindow they are screen units
542         height: int = ...,
543         name: str = ...,
544         orient: Literal["vertical", "horizontal"] = ...,
545         style: str = ...,
546         takefocus: tkinter._TakeFocusValue = ...,
547         width: int = ...,
548     ) -> None: ...
549     def add(self, child: tkinter.Widget, *, weight: int = ..., **kw) -> None: ...
550     @overload  # type: ignore
551     def configure(
552         self,
553         cnf: dict[str, Any] | None = ...,
554         *,
555         cursor: tkinter._Cursor = ...,
556         height: int = ...,
557         style: str = ...,
558         takefocus: tkinter._TakeFocusValue = ...,
559         width: int = ...,
560     ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
561     @overload
562     def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
563     # config must be copy/pasted, otherwise ttk.Panedwindow().config is mypy error (don't know why)
564     @overload  # type: ignore
565     def config(
566         self,
567         cnf: dict[str, Any] | None = ...,
568         *,
569         cursor: tkinter._Cursor = ...,
570         height: int = ...,
571         style: str = ...,
572         takefocus: tkinter._TakeFocusValue = ...,
573         width: int = ...,
574     ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
575     @overload
576     def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
577     forget: Any
578     def insert(self, pos, child, **kw): ...
579     def pane(self, pane, option: Any | None = ..., **kw): ...
580     def sashpos(self, index, newpos: Any | None = ...): ...
581
582 PanedWindow = Panedwindow
583
584 class Progressbar(Widget):
585     def __init__(
586         self,
587         master: tkinter.Misc | None = ...,
588         *,
589         class_: str = ...,
590         cursor: tkinter._Cursor = ...,
591         length: tkinter._ScreenUnits = ...,
592         maximum: float = ...,
593         mode: Literal["determinate", "indeterminate"] = ...,
594         name: str = ...,
595         orient: Literal["horizontal", "vertical"] = ...,
596         phase: int = ...,  # docs say read-only but assigning int to this works
597         style: str = ...,
598         takefocus: tkinter._TakeFocusValue = ...,
599         value: float = ...,
600         variable: tkinter.IntVar | tkinter.DoubleVar = ...,
601     ) -> None: ...
602     @overload
603     def configure(
604         self,
605         cnf: dict[str, Any] | None = ...,
606         *,
607         cursor: tkinter._Cursor = ...,
608         length: tkinter._ScreenUnits = ...,
609         maximum: float = ...,
610         mode: Literal["determinate", "indeterminate"] = ...,
611         orient: Literal["horizontal", "vertical"] = ...,
612         phase: int = ...,
613         style: str = ...,
614         takefocus: tkinter._TakeFocusValue = ...,
615         value: float = ...,
616         variable: tkinter.IntVar | tkinter.DoubleVar = ...,
617     ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
618     @overload
619     def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
620     config = configure
621     def start(self, interval: Any | None = ...): ...
622     def step(self, amount: Any | None = ...): ...
623     def stop(self): ...
624
625 class Radiobutton(Widget):
626     def __init__(
627         self,
628         master: tkinter.Misc | None = ...,
629         *,
630         class_: str = ...,
631         command: tkinter._ButtonCommand = ...,
632         compound: _TtkCompound = ...,
633         cursor: tkinter._Cursor = ...,
634         image: tkinter._ImageSpec = ...,
635         name: str = ...,
636         padding: Any = ...,  # undocumented
637         state: str = ...,
638         style: str = ...,
639         takefocus: tkinter._TakeFocusValue = ...,
640         text: float | str = ...,
641         textvariable: tkinter.Variable = ...,
642         underline: int = ...,
643         value: Any = ...,
644         variable: tkinter.Variable | Literal[""] = ...,
645         width: int | Literal[""] = ...,
646     ) -> None: ...
647     @overload
648     def configure(
649         self,
650         cnf: dict[str, Any] | None = ...,
651         *,
652         command: tkinter._ButtonCommand = ...,
653         compound: _TtkCompound = ...,
654         cursor: tkinter._Cursor = ...,
655         image: tkinter._ImageSpec = ...,
656         padding: Any = ...,
657         state: str = ...,
658         style: str = ...,
659         takefocus: tkinter._TakeFocusValue = ...,
660         text: float | str = ...,
661         textvariable: tkinter.Variable = ...,
662         underline: int = ...,
663         value: Any = ...,
664         variable: tkinter.Variable | Literal[""] = ...,
665         width: int | Literal[""] = ...,
666     ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
667     @overload
668     def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
669     config = configure
670     def invoke(self) -> Any: ...
671
672 class Scale(Widget, tkinter.Scale):
673     def __init__(
674         self,
675         master: tkinter.Misc | None = ...,
676         *,
677         class_: str = ...,
678         command: str | Callable[[str], Any] = ...,
679         cursor: tkinter._Cursor = ...,
680         from_: float = ...,
681         length: tkinter._ScreenUnits = ...,
682         name: str = ...,
683         orient: Literal["horizontal", "vertical"] = ...,
684         state: str = ...,  # undocumented
685         style: str = ...,
686         takefocus: tkinter._TakeFocusValue = ...,
687         to: float = ...,
688         value: float = ...,
689         variable: tkinter.IntVar | tkinter.DoubleVar = ...,
690     ) -> None: ...
691     @overload  # type: ignore
692     def configure(
693         self,
694         cnf: dict[str, Any] | None = ...,
695         *,
696         command: str | Callable[[str], Any] = ...,
697         cursor: tkinter._Cursor = ...,
698         from_: float = ...,
699         length: tkinter._ScreenUnits = ...,
700         orient: Literal["horizontal", "vertical"] = ...,
701         state: str = ...,
702         style: str = ...,
703         takefocus: tkinter._TakeFocusValue = ...,
704         to: float = ...,
705         value: float = ...,
706         variable: tkinter.IntVar | tkinter.DoubleVar = ...,
707     ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
708     @overload
709     def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
710     # config must be copy/pasted, otherwise ttk.Scale().config is mypy error (don't know why)
711     @overload  # type: ignore
712     def config(
713         self,
714         cnf: dict[str, Any] | None = ...,
715         *,
716         command: str | Callable[[str], Any] = ...,
717         cursor: tkinter._Cursor = ...,
718         from_: float = ...,
719         length: tkinter._ScreenUnits = ...,
720         orient: Literal["horizontal", "vertical"] = ...,
721         state: str = ...,
722         style: str = ...,
723         takefocus: tkinter._TakeFocusValue = ...,
724         to: float = ...,
725         value: float = ...,
726         variable: tkinter.IntVar | tkinter.DoubleVar = ...,
727     ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
728     @overload
729     def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
730     def get(self, x: Any | None = ..., y: Any | None = ...): ...
731
732 class Scrollbar(Widget, tkinter.Scrollbar):
733     def __init__(
734         self,
735         master: tkinter.Misc | None = ...,
736         *,
737         class_: str = ...,
738         command: Callable[..., tuple[float, float] | None] | str = ...,
739         cursor: tkinter._Cursor = ...,
740         name: str = ...,
741         orient: Literal["horizontal", "vertical"] = ...,
742         style: str = ...,
743         takefocus: tkinter._TakeFocusValue = ...,
744     ) -> None: ...
745     @overload  # type: ignore
746     def configure(
747         self,
748         cnf: dict[str, Any] | None = ...,
749         *,
750         command: Callable[..., tuple[float, float] | None] | str = ...,
751         cursor: tkinter._Cursor = ...,
752         orient: Literal["horizontal", "vertical"] = ...,
753         style: str = ...,
754         takefocus: tkinter._TakeFocusValue = ...,
755     ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
756     @overload
757     def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
758     # config must be copy/pasted, otherwise ttk.Scrollbar().config is mypy error (don't know why)
759     @overload  # type: ignore
760     def config(
761         self,
762         cnf: dict[str, Any] | None = ...,
763         *,
764         command: Callable[..., tuple[float, float] | None] | str = ...,
765         cursor: tkinter._Cursor = ...,
766         orient: Literal["horizontal", "vertical"] = ...,
767         style: str = ...,
768         takefocus: tkinter._TakeFocusValue = ...,
769     ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
770     @overload
771     def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
772
773 class Separator(Widget):
774     def __init__(
775         self,
776         master: tkinter.Misc | None = ...,
777         *,
778         class_: str = ...,
779         cursor: tkinter._Cursor = ...,
780         name: str = ...,
781         orient: Literal["horizontal", "vertical"] = ...,
782         style: str = ...,
783         takefocus: tkinter._TakeFocusValue = ...,
784     ) -> None: ...
785     @overload
786     def configure(
787         self,
788         cnf: dict[str, Any] | None = ...,
789         *,
790         cursor: tkinter._Cursor = ...,
791         orient: Literal["horizontal", "vertical"] = ...,
792         style: str = ...,
793         takefocus: tkinter._TakeFocusValue = ...,
794     ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
795     @overload
796     def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
797     config = configure
798
799 class Sizegrip(Widget):
800     def __init__(
801         self,
802         master: tkinter.Misc | None = ...,
803         *,
804         class_: str = ...,
805         cursor: tkinter._Cursor = ...,
806         name: str = ...,
807         style: str = ...,
808         takefocus: tkinter._TakeFocusValue = ...,
809     ) -> None: ...
810     @overload
811     def configure(
812         self,
813         cnf: dict[str, Any] | None = ...,
814         *,
815         cursor: tkinter._Cursor = ...,
816         style: str = ...,
817         takefocus: tkinter._TakeFocusValue = ...,
818     ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
819     @overload
820     def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
821     config = configure
822
823 if sys.version_info >= (3, 7):
824     class Spinbox(Entry):
825         def __init__(
826             self,
827             master: tkinter.Misc | None = ...,
828             *,
829             background: tkinter._Color = ...,  # undocumented
830             class_: str = ...,
831             command: Callable[[], Any] | str | list[str] | Tuple[str, ...] = ...,
832             cursor: tkinter._Cursor = ...,
833             exportselection: bool = ...,  # undocumented
834             font: _FontDescription = ...,  # undocumented
835             foreground: tkinter._Color = ...,  # undocumented
836             format: str = ...,
837             from_: float = ...,
838             increment: float = ...,
839             invalidcommand: tkinter._EntryValidateCommand = ...,  # undocumented
840             justify: Literal["left", "center", "right"] = ...,  # undocumented
841             name: str = ...,
842             show: Any = ...,  # undocumented
843             state: str = ...,
844             style: str = ...,
845             takefocus: tkinter._TakeFocusValue = ...,
846             textvariable: tkinter.Variable = ...,  # undocumented
847             to: float = ...,
848             validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ...,
849             validatecommand: tkinter._EntryValidateCommand = ...,
850             values: list[str] | Tuple[str, ...] = ...,
851             width: int = ...,  # undocumented
852             wrap: bool = ...,
853             xscrollcommand: tkinter._XYScrollCommand = ...,
854         ) -> None: ...
855         @overload  # type: ignore
856         def configure(
857             self,
858             cnf: dict[str, Any] | None = ...,
859             *,
860             background: tkinter._Color = ...,
861             command: Callable[[], Any] | str | list[str] | Tuple[str, ...] = ...,
862             cursor: tkinter._Cursor = ...,
863             exportselection: bool = ...,
864             font: _FontDescription = ...,
865             foreground: tkinter._Color = ...,
866             format: str = ...,
867             from_: float = ...,
868             increment: float = ...,
869             invalidcommand: tkinter._EntryValidateCommand = ...,
870             justify: Literal["left", "center", "right"] = ...,
871             show: Any = ...,
872             state: str = ...,
873             style: str = ...,
874             takefocus: tkinter._TakeFocusValue = ...,
875             textvariable: tkinter.Variable = ...,
876             to: float = ...,
877             validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ...,
878             validatecommand: tkinter._EntryValidateCommand = ...,
879             values: list[str] | Tuple[str, ...] = ...,
880             width: int = ...,
881             wrap: bool = ...,
882             xscrollcommand: tkinter._XYScrollCommand = ...,
883         ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
884         @overload
885         def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
886         config = configure  # type: ignore
887         def set(self, value: Any) -> None: ...
888
889 class _TreeviewItemDict(TypedDict):
890     text: str
891     image: list[str] | Literal[""]  # no idea why it's wrapped in list
892     values: list[Any] | Literal[""]
893     open: bool  # actually 0 or 1
894     tags: list[str] | Literal[""]
895
896 class _TreeviewTagDict(TypedDict):
897     # There is also 'text' and 'anchor', but they don't seem to do anything, using them is likely a bug
898     foreground: tkinter._Color
899     background: tkinter._Color
900     font: _FontDescription
901     image: Literal[""] | str  # not wrapped in list :D
902
903 class _TreeviewHeaderDict(TypedDict):
904     text: str
905     image: list[str]
906     anchor: tkinter._Anchor
907     command: str
908     state: str  # Doesn't seem to appear anywhere else than in these dicts
909
910 class _TreeviewColumnDict(TypedDict):
911     width: int
912     minwidth: int
913     stretch: bool  # actually 0 or 1
914     anchor: tkinter._Anchor
915     id: str
916
917 _TreeviewColumnId = Union[int, str]  # manual page: "COLUMN IDENTIFIERS"
918
919 class Treeview(Widget, tkinter.XView, tkinter.YView):
920     def __init__(
921         self,
922         master: tkinter.Misc | None = ...,
923         *,
924         class_: str = ...,
925         columns: str | list[str] | Tuple[str, ...] = ...,
926         cursor: tkinter._Cursor = ...,
927         displaycolumns: str | list[str] | Tuple[str, ...] | list[int] | Tuple[int, ...] | Literal["#all"] = ...,
928         height: int = ...,
929         name: str = ...,
930         padding: tkinter._Padding = ...,
931         selectmode: Literal["extended", "browse", "none"] = ...,
932         # list/tuple of Literal don't actually work in mypy
933         #
934         # 'tree headings' is same as ['tree', 'headings'], and I wouldn't be
935         # surprised if someone is using it.
936         show: Literal["tree", "headings", "tree headings", ""] | list[str] | Tuple[str, ...] = ...,
937         style: str = ...,
938         takefocus: tkinter._TakeFocusValue = ...,
939         xscrollcommand: tkinter._XYScrollCommand = ...,
940         yscrollcommand: tkinter._XYScrollCommand = ...,
941     ) -> None: ...
942     @overload
943     def configure(
944         self,
945         cnf: dict[str, Any] | None = ...,
946         *,
947         columns: str | list[str] | Tuple[str, ...] = ...,
948         cursor: tkinter._Cursor = ...,
949         displaycolumns: str | list[str] | Tuple[str, ...] | list[int] | Tuple[int, ...] | Literal["#all"] = ...,
950         height: int = ...,
951         padding: tkinter._Padding = ...,
952         selectmode: Literal["extended", "browse", "none"] = ...,
953         show: Literal["tree", "headings", "tree headings", ""] | list[str] | Tuple[str, ...] = ...,
954         style: str = ...,
955         takefocus: tkinter._TakeFocusValue = ...,
956         xscrollcommand: tkinter._XYScrollCommand = ...,
957         yscrollcommand: tkinter._XYScrollCommand = ...,
958     ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
959     @overload
960     def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
961     config = configure
962     def bbox(self, item, column: _TreeviewColumnId | None = ...) -> tuple[int, int, int, int] | Literal[""]: ...  # type: ignore
963     def get_children(self, item: str | None = ...) -> Tuple[str, ...]: ...
964     def set_children(self, item: str, *newchildren: str) -> None: ...
965     @overload
966     def column(self, column: _TreeviewColumnId, option: Literal["width", "minwidth"]) -> int: ...
967     @overload
968     def column(self, column: _TreeviewColumnId, option: Literal["stretch"]) -> bool: ...  # actually 0 or 1
969     @overload
970     def column(self, column: _TreeviewColumnId, option: Literal["anchor"]) -> _tkinter.Tcl_Obj: ...
971     @overload
972     def column(self, column: _TreeviewColumnId, option: Literal["id"]) -> str: ...
973     @overload
974     def column(self, column: _TreeviewColumnId, option: str) -> Any: ...
975     @overload
976     def column(
977         self,
978         column: _TreeviewColumnId,
979         option: None = ...,
980         *,
981         width: int = ...,
982         minwidth: int = ...,
983         stretch: bool = ...,
984         anchor: tkinter._Anchor = ...,
985         # id is read-only
986     ) -> _TreeviewColumnDict | None: ...
987     def delete(self, *items: str) -> None: ...
988     def detach(self, *items: str) -> None: ...
989     def exists(self, item: str) -> bool: ...
990     @overload  # type: ignore
991     def focus(self, item: None = ...) -> str: ...  # can return empty string
992     @overload
993     def focus(self, item: str) -> Literal[""]: ...
994     @overload
995     def heading(self, column: _TreeviewColumnId, option: Literal["text"]) -> str: ...
996     @overload
997     def heading(self, column: _TreeviewColumnId, option: Literal["image"]) -> tuple[str]: ...
998     @overload
999     def heading(self, column: _TreeviewColumnId, option: Literal["anchor"]) -> _tkinter.Tcl_Obj: ...
1000     @overload
1001     def heading(self, column: _TreeviewColumnId, option: Literal["command"]) -> str: ...
1002     @overload
1003     def heading(self, column: _TreeviewColumnId, option: str) -> Any: ...
1004     @overload
1005     def heading(
1006         self,
1007         column: _TreeviewColumnId,
1008         option: None = ...,
1009         *,
1010         text: str = ...,
1011         image: tkinter._ImageSpec = ...,
1012         anchor: tkinter._Anchor = ...,
1013         command: str | Callable[[], Any] = ...,
1014     ) -> _TreeviewHeaderDict | None: ...
1015     def identify(self, component, x, y): ...
1016     def identify_row(self, y: int) -> str: ...
1017     def identify_column(self, x: int) -> str: ...
1018     def identify_region(self, x: int, y: int) -> Literal["heading", "separator", "tree", "cell", "nothing"]: ...
1019     def identify_element(self, x: int, y: int) -> str: ...  # don't know what possible return values are
1020     def index(self, item: str) -> int: ...
1021     def insert(
1022         self,
1023         parent: str,
1024         index: int | Literal["end"],
1025         iid: str | None = ...,
1026         *,
1027         id: str = ...,  # same as iid
1028         text: str = ...,
1029         image: tkinter._ImageSpec = ...,
1030         values: list[Any] | Tuple[Any, ...] = ...,
1031         open: bool = ...,
1032         tags: str | list[str] | Tuple[str, ...] = ...,
1033     ) -> str: ...
1034     @overload
1035     def item(self, item: str, option: Literal["text"]) -> str: ...
1036     @overload
1037     def item(self, item: str, option: Literal["image"]) -> tuple[str] | Literal[""]: ...
1038     @overload
1039     def item(self, item: str, option: Literal["values"]) -> Tuple[Any, ...] | Literal[""]: ...
1040     @overload
1041     def item(self, item: str, option: Literal["open"]) -> bool: ...  # actually 0 or 1
1042     @overload
1043     def item(self, item: str, option: Literal["tags"]) -> Tuple[str, ...] | Literal[""]: ...
1044     @overload
1045     def item(self, item: str, option: str) -> Any: ...
1046     @overload
1047     def item(
1048         self,
1049         item: str,
1050         option: None = ...,
1051         *,
1052         text: str = ...,
1053         image: tkinter._ImageSpec = ...,
1054         values: list[Any] | Tuple[Any, ...] | Literal[""] = ...,
1055         open: bool = ...,
1056         tags: str | list[str] | Tuple[str, ...] = ...,
1057     ) -> _TreeviewItemDict | None: ...
1058     def move(self, item: str, parent: str, index: int) -> None: ...
1059     reattach = move
1060     def next(self, item: str) -> str: ...  # returning empty string means last item
1061     def parent(self, item: str) -> str: ...
1062     def prev(self, item: str) -> str: ...  # returning empty string means first item
1063     def see(self, item: str) -> None: ...
1064     if sys.version_info >= (3, 8):
1065         def selection(self) -> Tuple[str, ...]: ...
1066     else:
1067         def selection(self, selop: Any | None = ..., items: Any | None = ...) -> Tuple[str, ...]: ...
1068     def selection_set(self, items: str | list[str] | Tuple[str, ...]) -> None: ...
1069     def selection_add(self, items: str | list[str] | Tuple[str, ...]) -> None: ...
1070     def selection_remove(self, items: str | list[str] | Tuple[str, ...]) -> None: ...
1071     def selection_toggle(self, items: str | list[str] | Tuple[str, ...]) -> None: ...
1072     @overload
1073     def set(self, item: str, column: None = ..., value: None = ...) -> dict[str, Any]: ...
1074     @overload
1075     def set(self, item: str, column: _TreeviewColumnId, value: None = ...) -> Any: ...
1076     @overload
1077     def set(self, item: str, column: _TreeviewColumnId, value: Any) -> Literal[""]: ...
1078     # There's no tag_unbind() or 'add' argument for whatever reason.
1079     # Also, it's 'callback' instead of 'func' here.
1080     @overload
1081     def tag_bind(
1082         self, tagname: str, sequence: str | None = ..., callback: Callable[[tkinter.Event[Treeview]], Any] | None = ...
1083     ) -> str: ...
1084     @overload
1085     def tag_bind(self, tagname: str, sequence: str | None, callback: str) -> None: ...
1086     @overload
1087     def tag_bind(self, tagname: str, *, callback: str) -> None: ...
1088     @overload
1089     def tag_configure(self, tagname: str, option: Literal["foreground", "background"]) -> tkinter._Color: ...
1090     @overload
1091     def tag_configure(self, tagname: str, option: Literal["font"]) -> _FontDescription: ...
1092     @overload
1093     def tag_configure(self, tagname: str, option: Literal["image"]) -> str: ...
1094     @overload
1095     def tag_configure(
1096         self,
1097         tagname: str,
1098         option: None = ...,
1099         *,
1100         # There is also 'text' and 'anchor', but they don't seem to do anything, using them is likely a bug
1101         foreground: tkinter._Color = ...,
1102         background: tkinter._Color = ...,
1103         font: _FontDescription = ...,
1104         image: tkinter._ImageSpec = ...,
1105     ) -> _TreeviewTagDict | Any: ...  # can be None but annoying to check
1106     @overload
1107     def tag_has(self, tagname: str, item: None = ...) -> Tuple[str, ...]: ...
1108     @overload
1109     def tag_has(self, tagname: str, item: str) -> bool: ...
1110
1111 class LabeledScale(Frame):
1112     label: Any
1113     scale: Any
1114     # TODO: don't any-type **kw. That goes to Frame.__init__.
1115     def __init__(
1116         self,
1117         master: tkinter.Misc | None = ...,
1118         variable: tkinter.IntVar | tkinter.DoubleVar | None = ...,
1119         from_: float = ...,
1120         to: float = ...,
1121         *,
1122         compound: Literal["top"] | Literal["bottom"] = ...,
1123         **kw: Any,
1124     ) -> None: ...
1125     # destroy is overridden, signature does not change
1126     value: Any
1127
1128 class OptionMenu(Menubutton):
1129     def __init__(
1130         self,
1131         master,
1132         variable,
1133         default: str | None = ...,
1134         *values: str,
1135         # rest of these are keyword-only because *args syntax used above
1136         style: str = ...,
1137         direction: Literal["above"] | Literal["below"] | Literal["left"] | Literal["right"] | Literal["flush"] = ...,
1138         command: Callable[[tkinter.StringVar], Any] | None = ...,
1139     ) -> None: ...
1140     # configure, config, cget, destroy are inherited from Menubutton
1141     # destroy and __setitem__ are overridden, signature does not change
1142     def set_menu(self, default: Any | None = ..., *values): ...