3 from _typeshed import StrOrBytesPath
5 from tkinter.constants import * # comment this out to find undefined identifier names with flake8
6 from tkinter.font import _FontDescription
7 from types import TracebackType
8 from typing import Any, Callable, Generic, List, Mapping, Optional, Protocol, Sequence, Tuple, Type, TypeVar, Union, overload
9 from typing_extensions import Literal, TypedDict
11 # Using anything from tkinter.font in this file means that 'import tkinter'
12 # seems to also load tkinter.font. That's not how it actually works, but
13 # unfortunately not much can be done about it. https://github.com/python/typeshed/pull/4346
15 TclError = _tkinter.TclError
19 READABLE = _tkinter.READABLE
20 WRITABLE = _tkinter.WRITABLE
21 EXCEPTION = _tkinter.EXCEPTION
23 # Quick guide for figuring out which widget class to choose:
24 # - Misc: any widget (don't use BaseWidget because Tk doesn't inherit from BaseWidget)
25 # - Widget: anything that is meant to be put into another widget with e.g. pack or grid
27 # Instructions for figuring out the correct type of each widget option:
28 # - See discussion on #4363.
30 # - Find the option from the manual page of the widget. Usually the manual
31 # page of a non-ttk widget has the same name as the tkinter class, in the
34 # $ sudo apt install tk-doc
37 # Ttk manual pages tend to have ttk_ prefixed names:
41 # Non-GUI things like the .after() method are often in the 3tcl section:
43 # $ sudo apt install tcl-doc
46 # If you don't have man or apt, you can read these manual pages online:
48 # https://www.tcl.tk/doc/
50 # Every option has '-' in front of its name in the manual page (and in Tcl).
51 # For example, there's an option named '-text' in the label manual page.
53 # - Tkinter has some options documented in docstrings, but don't rely on them.
54 # They aren't updated when a new version of Tk comes out, so the latest Tk
55 # manual pages (see above) are much more likely to actually contain all
58 # Also, reading tkinter's source code typically won't help much because it
59 # uses a lot of **kwargs and duck typing. Typically every argument goes into
60 # self.tk.call, which is _tkinter.TkappType.call, and the return value is
61 # whatever that returns. The type of that depends on how the Tcl interpreter
62 # represents the return value of the executed Tcl code.
64 # - If you think that int is an appropriate type for something, then you may
65 # actually want _ScreenUnits instead.
67 # - If you think that Callable[something] is an appropriate type for
68 # something, then you may actually want Callable[something] | str,
69 # because it's often possible to specify a string of Tcl code.
71 # - If you think the correct type is Iterable[Foo] or Sequence[Foo], it is
72 # probably list[Foo] | tuple[Foo, ...], disallowing other sequences such
75 # >>> tkinter.Label(font=('Helvetica', 12, collections.deque(['bold'])))
76 # Traceback (most recent call last):
78 # _tkinter.TclError: unknown font style "deque(['bold'])"
80 # - Some options can be set only in __init__, but all options are available
81 # when getting their values with configure's return value or cget.
83 # - Asks other tkinter users if you haven't worked much with tkinter.
85 # Some widgets have an option named -compound that accepts different values
86 # than the _Compound defined here. Many other options have similar things.
87 _Anchor = Literal["nw", "n", "ne", "w", "center", "e", "sw", "s", "se"] # manual page: Tk_GetAnchor
88 _Bitmap = str # manual page: Tk_GetBitmap
89 _ButtonCommand = Union[str, Callable[[], Any]] # return value is returned from Button.invoke()
91 _Color = str # typically '#rrggbb', '#rgb' or color names.
92 _Compound = Literal["top", "left", "center", "right", "bottom", "none"] # -compound in manual page named 'options'
93 _Cursor = Union[str, Tuple[str], Tuple[str, str], Tuple[str, str, str], Tuple[str, str, str, str]] # manual page: Tk_GetCursor
94 _EntryValidateCommand = Union[
95 Callable[[], bool], str, List[str], Tuple[str, ...]
96 ] # example when it's sequence: entry['invalidcommand'] = [entry.register(print), '%P']
97 _GridIndex = Union[int, str, Literal["all"]]
98 _ImageSpec = Union[_Image, str] # str can be from e.g. tkinter.image_names()
102 Tuple[_ScreenUnits, _ScreenUnits],
103 Tuple[_ScreenUnits, _ScreenUnits, _ScreenUnits],
104 Tuple[_ScreenUnits, _ScreenUnits, _ScreenUnits, _ScreenUnits],
106 _Relief = Literal["raised", "sunken", "flat", "ridge", "solid", "groove"] # manual page: Tk_GetRelief
107 _ScreenUnits = Union[str, float] # manual page: Tk_GetPixels
108 _XYScrollCommand = Union[str, Callable[[float, float], Any]] # -xscrollcommand and -yscrollcommand in 'options' manual page
109 _TakeFocusValue = Union[int, Literal[""], Callable[[str], Optional[bool]]] # -takefocus in manual page named 'options'
111 class EventType(str, Enum):
116 CirculateRequest: str
120 ConfigureRequest: str
145 SelectionRequest: str
150 _W = TypeVar("_W", bound="Misc")
151 # Events considered covariant because you should never assign to event.widget.
152 _W_co = TypeVar("_W_co", covariant=True, bound="Misc")
154 class Event(Generic[_W_co]):
175 def NoDefaultRoot(): ...
177 _TraceMode = Literal["array", "read", "write", "unset"]
180 def __init__(self, master: Misc | None = ..., value: Any | None = ..., name: str | None = ...) -> None: ...
181 def set(self, value: Any) -> None: ...
183 def get(self) -> Any: ...
184 def trace_add(self, mode: _TraceMode, callback: Callable[[str, str, str], Any]) -> str: ...
185 def trace_remove(self, mode: _TraceMode, cbname: str) -> None: ...
186 def trace_info(self) -> list[tuple[Tuple[_TraceMode, ...], str]]: ...
187 def trace_variable(self, mode, callback): ... # deprecated
188 def trace_vdelete(self, mode, cbname): ... # deprecated
189 def trace_vinfo(self): ... # deprecated
190 trace = trace_variable # deprecated
192 class StringVar(Variable):
193 def __init__(self, master: Misc | None = ..., value: str | None = ..., name: str | None = ...) -> None: ...
194 def set(self, value: str) -> None: ...
196 def get(self) -> str: ...
198 class IntVar(Variable):
199 def __init__(self, master: Misc | None = ..., value: int | None = ..., name: str | None = ...) -> None: ...
200 def set(self, value: int) -> None: ...
202 def get(self) -> int: ...
204 class DoubleVar(Variable):
205 def __init__(self, master: Misc | None = ..., value: float | None = ..., name: str | None = ...) -> None: ...
206 def set(self, value: float) -> None: ...
208 def get(self) -> float: ...
210 class BooleanVar(Variable):
211 def __init__(self, master: Misc | None = ..., value: bool | None = ..., name: str | None = ...) -> None: ...
212 def set(self, value: bool) -> None: ...
214 def get(self) -> bool: ...
216 def mainloop(n: int = ...) -> None: ...
221 def getboolean(s): ...
223 class _GridIndexInfo(TypedDict, total=False):
224 minsize: _ScreenUnits
231 tk: _tkinter.TkappType
232 children: dict[str, Widget]
233 def destroy(self) -> None: ...
234 def deletecommand(self, name: str) -> None: ...
235 def tk_strictMotif(self, boolean: Any | None = ...): ...
236 def tk_bisque(self): ...
237 def tk_setPalette(self, *args, **kw): ...
238 def wait_variable(self, name: str | Variable = ...) -> None: ...
239 waitvar = wait_variable
240 def wait_window(self, window: Misc | None = ...) -> None: ...
241 def wait_visibility(self, window: Misc | None = ...) -> None: ...
242 def setvar(self, name: str = ..., value: str = ...): ...
243 def getvar(self, name: str = ...): ...
244 def getint(self, s): ...
245 def getdouble(self, s): ...
246 def getboolean(self, s): ...
247 def focus_set(self) -> None: ...
249 def focus_force(self) -> None: ...
250 def focus_get(self) -> Misc | None: ...
251 def focus_displayof(self) -> Misc | None: ...
252 def focus_lastfor(self) -> Misc | None: ...
253 def tk_focusFollowsMouse(self) -> None: ...
254 def tk_focusNext(self) -> Misc | None: ...
255 def tk_focusPrev(self) -> Misc | None: ...
257 def after(self, ms: int, func: None = ...) -> None: ...
259 def after(self, ms: int | Literal["idle"], func: Callable[..., Any], *args: Any) -> str: ...
260 # after_idle is essentially partialmethod(after, "idle")
261 def after_idle(self, func: Callable[..., Any], *args: Any) -> str: ...
262 def after_cancel(self, id: str) -> None: ...
263 def bell(self, displayof: Literal[0] | Misc | None = ...): ...
264 def clipboard_get(self, *, displayof: Misc = ..., type: str = ...) -> str: ...
265 def clipboard_clear(self, *, displayof: Misc = ...) -> None: ...
266 def clipboard_append(self, string: str, *, displayof: Misc = ..., format: str = ..., type: str = ...): ...
267 def grab_current(self): ...
268 def grab_release(self): ...
269 def grab_set(self) -> None: ...
270 def grab_set_global(self) -> None: ...
271 def grab_status(self): ...
272 def option_add(self, pattern, value, priority: Any | None = ...): ...
273 def option_clear(self): ...
274 def option_get(self, name, className): ...
275 def option_readfile(self, fileName, priority: Any | None = ...): ...
276 def selection_clear(self, **kw): ...
277 def selection_get(self, **kw): ...
278 def selection_handle(self, command, **kw): ...
279 def selection_own(self, **kw): ...
280 def selection_own_get(self, **kw): ...
281 def send(self, interp, cmd, *args): ...
282 def lower(self, belowThis: Any | None = ...): ...
283 def tkraise(self, aboveThis: Any | None = ...): ...
285 def winfo_atom(self, name: str, displayof: Literal[0] | Misc | None = ...): ...
286 def winfo_atomname(self, id: int, displayof: Literal[0] | Misc | None = ...): ...
287 def winfo_cells(self) -> int: ...
288 def winfo_children(self) -> list[Widget]: ... # Widget because it can't be Toplevel or Tk
289 def winfo_class(self) -> str: ...
290 def winfo_colormapfull(self) -> bool: ...
291 def winfo_containing(self, rootX: int, rootY: int, displayof: Literal[0] | Misc | None = ...) -> Misc | None: ...
292 def winfo_depth(self) -> int: ...
293 def winfo_exists(self) -> bool: ...
294 def winfo_fpixels(self, number: _ScreenUnits) -> float: ...
295 def winfo_geometry(self) -> str: ...
296 def winfo_height(self) -> int: ...
297 def winfo_id(self) -> int: ...
298 def winfo_interps(self, displayof: Literal[0] | Misc | None = ...) -> Tuple[str, ...]: ...
299 def winfo_ismapped(self) -> bool: ...
300 def winfo_manager(self) -> str: ...
301 def winfo_name(self) -> str: ...
302 def winfo_parent(self) -> str: ... # return value needs nametowidget()
303 def winfo_pathname(self, id: int, displayof: Literal[0] | Misc | None = ...): ...
304 def winfo_pixels(self, number: _ScreenUnits) -> int: ...
305 def winfo_pointerx(self) -> int: ...
306 def winfo_pointerxy(self) -> tuple[int, int]: ...
307 def winfo_pointery(self) -> int: ...
308 def winfo_reqheight(self) -> int: ...
309 def winfo_reqwidth(self) -> int: ...
310 def winfo_rgb(self, color: _Color) -> tuple[int, int, int]: ...
311 def winfo_rootx(self) -> int: ...
312 def winfo_rooty(self) -> int: ...
313 def winfo_screen(self) -> str: ...
314 def winfo_screencells(self) -> int: ...
315 def winfo_screendepth(self) -> int: ...
316 def winfo_screenheight(self) -> int: ...
317 def winfo_screenmmheight(self) -> int: ...
318 def winfo_screenmmwidth(self) -> int: ...
319 def winfo_screenvisual(self) -> str: ...
320 def winfo_screenwidth(self) -> int: ...
321 def winfo_server(self) -> str: ...
322 def winfo_toplevel(self) -> Tk | Toplevel: ...
323 def winfo_viewable(self) -> bool: ...
324 def winfo_visual(self) -> str: ...
325 def winfo_visualid(self) -> str: ...
326 def winfo_visualsavailable(self, includeids: int = ...) -> list[tuple[str, int]]: ...
327 def winfo_vrootheight(self) -> int: ...
328 def winfo_vrootwidth(self) -> int: ...
329 def winfo_vrootx(self) -> int: ...
330 def winfo_vrooty(self) -> int: ...
331 def winfo_width(self) -> int: ...
332 def winfo_x(self) -> int: ...
333 def winfo_y(self) -> int: ...
334 def update(self) -> None: ...
335 def update_idletasks(self) -> None: ...
336 def bindtags(self, tagList: Any | None = ...): ...
337 # bind with isinstance(func, str) doesn't return anything, but all other
338 # binds do. The default value of func is not str.
342 sequence: str | None = ...,
343 func: Callable[[Event[Misc]], Any] | None = ...,
344 add: Literal["", "+"] | bool | None = ...,
347 def bind(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ...
349 def bind(self, *, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ...
350 # There's no way to know what type of widget bind_all and bind_class
351 # callbacks will get, so those are Misc.
355 sequence: str | None = ...,
356 func: Callable[[Event[Misc]], Any] | None = ...,
357 add: Literal["", "+"] | bool | None = ...,
360 def bind_all(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ...
362 def bind_all(self, *, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ...
367 sequence: str | None = ...,
368 func: Callable[[Event[Misc]], Any] | None = ...,
369 add: Literal["", "+"] | bool | None = ...,
372 def bind_class(self, className: str, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ...
374 def bind_class(self, className: str, *, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ...
375 def unbind(self, sequence: str, funcid: str | None = ...) -> None: ...
376 def unbind_all(self, sequence: str) -> None: ...
377 def unbind_class(self, className: str, sequence: str) -> None: ...
378 def mainloop(self, n: int = ...) -> None: ...
380 def nametowidget(self, name: str | Misc | _tkinter.Tcl_Obj) -> Any: ...
382 self, func: Callable[..., Any], subst: Callable[..., Sequence[Any]] | None = ..., needcleanup: int = ...
384 def keys(self) -> list[str]: ...
386 def pack_propagate(self, flag: bool) -> bool | None: ...
388 def pack_propagate(self) -> None: ...
389 propagate = pack_propagate
390 def grid_anchor(self, anchor: _Anchor | None = ...) -> None: ...
394 self, column: None = ..., row: None = ..., col2: None = ..., row2: None = ...
395 ) -> tuple[int, int, int, int] | None: ...
397 def grid_bbox(self, column: int, row: int, col2: None = ..., row2: None = ...) -> tuple[int, int, int, int] | None: ...
399 def grid_bbox(self, column: int, row: int, col2: int, row2: int) -> tuple[int, int, int, int] | None: ...
401 def grid_columnconfigure(
404 cnf: _GridIndexInfo = ...,
406 minsize: _ScreenUnits = ...,
407 pad: _ScreenUnits = ...,
410 ) -> _GridIndexInfo | Any: ... # can be None but annoying to check
411 def grid_rowconfigure(
414 cnf: _GridIndexInfo = ...,
416 minsize: _ScreenUnits = ...,
417 pad: _ScreenUnits = ...,
420 ) -> _GridIndexInfo | Any: ... # can be None but annoying to check
421 columnconfigure = grid_columnconfigure
422 rowconfigure = grid_rowconfigure
423 def grid_location(self, x: _ScreenUnits, y: _ScreenUnits) -> tuple[int, int]: ...
425 def grid_propagate(self, flag: bool) -> None: ...
427 def grid_propagate(self) -> bool: ...
428 def grid_size(self) -> tuple[int, int]: ...
430 # Widget because Toplevel or Tk is never a slave
431 def pack_slaves(self) -> list[Widget]: ...
432 def grid_slaves(self, row: int | None = ..., column: int | None = ...) -> list[Widget]: ...
433 def place_slaves(self) -> list[Widget]: ...
435 def event_add(self, virtual: str, *sequences: str) -> None: ...
436 def event_delete(self, virtual: str, *sequences: str) -> None: ...
441 above: Misc | int = ...,
442 borderwidth: _ScreenUnits = ...,
445 data: Any = ..., # anything with usable str() value
449 height: _ScreenUnits = ...,
453 override: bool = ...,
454 place: Literal["PlaceOnTop", "PlaceOnBottom"] = ...,
455 root: Misc | int = ...,
456 rootx: _ScreenUnits = ...,
457 rooty: _ScreenUnits = ...,
458 sendevent: bool = ...,
460 state: int | str = ...,
461 subwindow: Misc | int = ...,
464 width: _ScreenUnits = ...,
465 when: Literal["now", "tail", "head", "mark"] = ...,
466 x: _ScreenUnits = ...,
467 y: _ScreenUnits = ...,
469 def event_info(self, virtual: str | None = ...) -> Tuple[str, ...]: ...
470 def image_names(self) -> Tuple[str, ...]: ...
471 def image_types(self) -> Tuple[str, ...]: ...
472 # See #4363 and #4891
473 def __setitem__(self, key: str, value: Any) -> None: ...
474 def __getitem__(self, key: str) -> Any: ...
475 def cget(self, key: str) -> Any: ...
476 def configure(self, cnf: Any = ...) -> Any: ...
477 # TODO: config is an alias of configure, but adding that here creates lots of mypy errors
483 def __init__(self, func, subst, widget): ...
484 def __call__(self, *args): ...
488 def xview(self) -> tuple[float, float]: ...
490 def xview(self, *args: Any) -> Any: ...
491 def xview_moveto(self, fraction: float) -> None: ...
493 def xview_scroll(self, number: int, what: Literal["units", "pages"]) -> None: ...
495 def xview_scroll(self, number: _ScreenUnits, what: Literal["pixels"]) -> None: ...
499 def yview(self) -> tuple[float, float]: ...
501 def yview(self, *args: Any) -> Any: ...
502 def yview_moveto(self, fraction: float) -> None: ...
504 def yview_scroll(self, number: int, what: Literal["units", "pages"]) -> None: ...
506 def yview_scroll(self, number: _ScreenUnits, what: Literal["pixels"]) -> None: ...
510 def wm_aspect(self, minNumer: int, minDenom: int, maxNumer: int, maxDenom: int) -> None: ...
513 self, minNumer: None = ..., minDenom: None = ..., maxNumer: None = ..., maxDenom: None = ...
514 ) -> tuple[int, int, int, int] | None: ...
517 def wm_attributes(self) -> Tuple[Any, ...]: ...
519 def wm_attributes(self, __option: str) -> Any: ...
521 def wm_attributes(self, __option: str, __value: Any, *__other_option_value_pairs: Any) -> None: ...
522 attributes = wm_attributes
523 def wm_client(self, name: str | None = ...) -> str: ...
526 def wm_colormapwindows(self) -> list[Misc]: ...
528 def wm_colormapwindows(self, __wlist: list[Misc] | Tuple[Misc, ...]) -> None: ...
530 def wm_colormapwindows(self, __first_wlist_item: Misc, *other_wlist_items: Misc) -> None: ...
531 colormapwindows = wm_colormapwindows
532 def wm_command(self, value: str | None = ...) -> str: ...
534 # Some of these always return empty string, but return type is set to None to prevent accidentally using it
535 def wm_deiconify(self) -> None: ...
536 deiconify = wm_deiconify
537 def wm_focusmodel(self, model: Any | None = ...): ...
538 focusmodel = wm_focusmodel
539 def wm_forget(self, window: Wm) -> None: ...
541 def wm_frame(self): ...
544 def wm_geometry(self, newGeometry: None = ...) -> str: ...
546 def wm_geometry(self, newGeometry: str) -> None: ...
547 geometry = wm_geometry
549 self, baseWidth: Any | None = ..., baseHeight: Any | None = ..., widthInc: Any | None = ..., heightInc: Any | None = ...
552 def wm_group(self, pathName: Any | None = ...): ...
554 def wm_iconbitmap(self, bitmap: Any | None = ..., default: Any | None = ...): ...
555 iconbitmap = wm_iconbitmap
556 def wm_iconify(self) -> None: ...
558 def wm_iconmask(self, bitmap: Any | None = ...): ...
559 iconmask = wm_iconmask
560 def wm_iconname(self, newName: Any | None = ...): ...
561 iconname = wm_iconname
562 def wm_iconphoto(self, default: bool, __image1: Image, *args: Image) -> None: ...
563 iconphoto = wm_iconphoto
564 def wm_iconposition(self, x: Any | None = ..., y: Any | None = ...): ...
565 iconposition = wm_iconposition
566 def wm_iconwindow(self, pathName: Any | None = ...): ...
567 iconwindow = wm_iconwindow
568 def wm_manage(self, widget): ...
571 def wm_maxsize(self, width: None = ..., height: None = ...) -> tuple[int, int]: ...
573 def wm_maxsize(self, width: int, height: int) -> None: ...
576 def wm_minsize(self, width: None = ..., height: None = ...) -> tuple[int, int]: ...
578 def wm_minsize(self, width: int, height: int) -> None: ...
581 def wm_overrideredirect(self, boolean: None = ...) -> bool | None: ... # returns True or None
583 def wm_overrideredirect(self, boolean: bool) -> None: ...
584 overrideredirect = wm_overrideredirect
585 def wm_positionfrom(self, who: Any | None = ...): ...
586 positionfrom = wm_positionfrom
588 def wm_protocol(self, name: str, func: Callable[[], Any] | str) -> None: ...
590 def wm_protocol(self, name: str, func: None = ...) -> str: ...
592 def wm_protocol(self, name: None = ..., func: None = ...) -> Tuple[str, ...]: ...
593 protocol = wm_protocol
595 def wm_resizable(self, width: None = ..., height: None = ...) -> tuple[bool, bool]: ...
597 def wm_resizable(self, width: bool, height: bool) -> None: ...
598 resizable = wm_resizable
599 def wm_sizefrom(self, who: Any | None = ...): ...
600 sizefrom = wm_sizefrom
602 def wm_state(self, newstate: None = ...) -> str: ...
604 def wm_state(self, newstate: str) -> None: ...
607 def wm_title(self, string: None = ...) -> str: ...
609 def wm_title(self, string: str) -> None: ...
612 def wm_transient(self, master: None = ...) -> _tkinter.Tcl_Obj: ...
614 def wm_transient(self, master: Wm | _tkinter.Tcl_Obj) -> None: ...
615 transient = wm_transient
616 def wm_withdraw(self) -> None: ...
617 withdraw = wm_withdraw
619 class _ExceptionReportingCallback(Protocol):
620 def __call__(self, __exc: Type[BaseException], __val: BaseException, __tb: TracebackType | None) -> Any: ...
625 # please update ttkthemes stub if you change this
627 screenName: str | None = ...,
628 baseName: str | None = ...,
629 className: str = ...,
632 use: str | None = ...,
637 cnf: dict[str, Any] | None = ...,
639 background: _Color = ...,
640 bd: _ScreenUnits = ...,
642 border: _ScreenUnits = ...,
643 borderwidth: _ScreenUnits = ...,
644 cursor: _Cursor = ...,
645 height: _ScreenUnits = ...,
646 highlightbackground: _Color = ...,
647 highlightcolor: _Color = ...,
648 highlightthickness: _ScreenUnits = ...,
650 padx: _ScreenUnits = ...,
651 pady: _ScreenUnits = ...,
652 relief: _Relief = ...,
653 takefocus: _TakeFocusValue = ...,
654 width: _ScreenUnits = ...,
655 ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
657 def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
659 def loadtk(self) -> None: ... # differs from _tkinter.TkappType.loadtk
660 def destroy(self) -> None: ...
661 def readprofile(self, baseName: str, className: str) -> None: ...
662 report_callback_exception: _ExceptionReportingCallback
663 # Tk has __getattr__ so that tk_instance.foo falls back to tk_instance.tk.foo
664 # Please keep in sync with _tkinter.TkappType
665 call: Callable[..., Any]
666 def eval(self, __code: str) -> str: ...
669 createfilehandler: Any
670 createtimerhandler: Any
672 deletefilehandler: Any
697 def Tcl(screenName: Any | None = ..., baseName: Any | None = ..., className: str = ..., useTk: bool = ...): ...
699 _InMiscTotal = TypedDict("_InMiscTotal", {"in": Misc})
700 _InMiscNonTotal = TypedDict("_InMiscNonTotal", {"in": Misc}, total=False)
702 class _PackInfo(_InMiscTotal):
703 # 'before' and 'after' never appear in _PackInfo
706 fill: Literal["none", "x", "y", "both"]
707 side: Literal["left", "right", "top", "bottom"]
708 # Paddings come out as int or tuple of int, even though any _ScreenUnits
709 # can be specified in pack().
712 padx: int | tuple[int, int]
713 pady: int | tuple[int, int]
716 # _PackInfo is not the valid type for cnf because pad stuff accepts any
717 # _ScreenUnits instead of int only. I didn't bother to create another
718 # TypedDict for cnf because it appears to be a legacy thing that was
719 # replaced by **kwargs.
722 cnf: Mapping[str, Any] | None = ...,
725 anchor: _Anchor = ...,
728 fill: Literal["none", "x", "y", "both"] = ...,
729 side: Literal["left", "right", "top", "bottom"] = ...,
730 ipadx: _ScreenUnits = ...,
731 ipady: _ScreenUnits = ...,
732 padx: _ScreenUnits | tuple[_ScreenUnits, _ScreenUnits] = ...,
733 pady: _ScreenUnits | tuple[_ScreenUnits, _ScreenUnits] = ...,
735 **kw: Any, # allow keyword argument named 'in', see #4836
737 def pack_forget(self) -> None: ...
738 def pack_info(self) -> _PackInfo: ... # errors if widget hasn't been packed
739 pack = pack_configure
741 propagate = Misc.pack_propagate
742 # commented out to avoid mypy getting confused with multiple
743 # inheritance and how things get overridden with different things
745 # pack_propagate = Misc.pack_propagate
746 # configure = pack_configure
747 # config = pack_configure
748 # slaves = Misc.pack_slaves
749 # pack_slaves = Misc.pack_slaves
751 class _PlaceInfo(_InMiscNonTotal): # empty dict if widget hasn't been placed
753 bordermode: Literal["inside", "outside", "ignore"]
754 width: str # can be int()ed (even after e.g. widget.place(height='2.3c') or similar)
755 height: str # can be int()ed
756 x: str # can be int()ed
757 y: str # can be int()ed
758 relheight: str # can be float()ed if not empty string
759 relwidth: str # can be float()ed if not empty string
760 relx: str # can be float()ed if not empty string
761 rely: str # can be float()ed if not empty string
766 cnf: Mapping[str, Any] | None = ...,
768 anchor: _Anchor = ...,
769 bordermode: Literal["inside", "outside", "ignore"] = ...,
770 width: _ScreenUnits = ...,
771 height: _ScreenUnits = ...,
772 x: _ScreenUnits = ...,
773 y: _ScreenUnits = ...,
774 # str allowed for compatibility with place_info()
775 relheight: str | float = ...,
776 relwidth: str | float = ...,
777 relx: str | float = ...,
778 rely: str | float = ...,
780 **kw: Any, # allow keyword argument named 'in', see #4836
782 def place_forget(self) -> None: ...
783 def place_info(self) -> _PlaceInfo: ...
784 place = place_configure
786 # commented out to avoid mypy getting confused with multiple
787 # inheritance and how things get overridden with different things
788 # config = place_configure
789 # configure = place_configure
790 # forget = place_forget
791 # slaves = Misc.place_slaves
792 # place_slaves = Misc.place_slaves
794 class _GridInfo(_InMiscNonTotal): # empty dict if widget hasn't been gridded
801 padx: int | tuple[int, int]
802 pady: int | tuple[int, int]
803 sticky: str # consists of letters 'n', 's', 'w', 'e', no repeats, may be empty
808 cnf: Mapping[str, Any] | None = ...,
811 columnspan: int = ...,
814 ipadx: _ScreenUnits = ...,
815 ipady: _ScreenUnits = ...,
816 padx: _ScreenUnits | tuple[_ScreenUnits, _ScreenUnits] = ...,
817 pady: _ScreenUnits | tuple[_ScreenUnits, _ScreenUnits] = ...,
818 sticky: str = ..., # consists of letters 'n', 's', 'w', 'e', may contain repeats, may be empty
820 **kw: Any, # allow keyword argument named 'in', see #4836
822 def grid_forget(self) -> None: ...
823 def grid_remove(self) -> None: ...
824 def grid_info(self) -> _GridInfo: ...
825 grid = grid_configure
826 location = Misc.grid_location
827 size = Misc.grid_size
828 # commented out to avoid mypy getting confused with multiple
829 # inheritance and how things get overridden with different things
830 # bbox = Misc.grid_bbox
831 # grid_bbox = Misc.grid_bbox
832 # forget = grid_forget
834 # grid_location = Misc.grid_location
835 # grid_propagate = Misc.grid_propagate
836 # grid_size = Misc.grid_size
837 # rowconfigure = Misc.grid_rowconfigure
838 # grid_rowconfigure = Misc.grid_rowconfigure
839 # grid_columnconfigure = Misc.grid_columnconfigure
840 # columnconfigure = Misc.grid_columnconfigure
841 # config = grid_configure
842 # configure = grid_configure
843 # propagate = Misc.grid_propagate
844 # slaves = Misc.grid_slaves
845 # grid_slaves = Misc.grid_slaves
847 class BaseWidget(Misc):
850 def __init__(self, master, widgetName, cnf=..., kw=..., extra=...): ...
851 def destroy(self) -> None: ...
853 # This class represents any widget except Toplevel or Tk.
854 class Widget(BaseWidget, Pack, Place, Grid):
855 # Allow bind callbacks to take e.g. Event[Label] instead of Event[Misc].
856 # Tk and Toplevel get notified for their child widgets' events, but other
861 sequence: str | None = ...,
862 func: Callable[[Event[_W]], Any] | None = ...,
863 add: Literal["", "+"] | bool | None = ...,
866 def bind(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ...
868 def bind(self, *, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ...
870 class Toplevel(BaseWidget, Wm):
871 # Toplevel and Tk have the same options because they correspond to the same
872 # Tcl/Tk toplevel widget. For some reason, config and configure must be
873 # copy/pasted here instead of aliasing as 'config = Tk.config'.
876 master: Misc | None = ...,
877 cnf: dict[str, Any] | None = ...,
879 background: _Color = ...,
880 bd: _ScreenUnits = ...,
882 border: _ScreenUnits = ...,
883 borderwidth: _ScreenUnits = ...,
885 colormap: Literal["new", ""] | Misc = ...,
886 container: bool = ...,
887 cursor: _Cursor = ...,
888 height: _ScreenUnits = ...,
889 highlightbackground: _Color = ...,
890 highlightcolor: _Color = ...,
891 highlightthickness: _ScreenUnits = ...,
894 padx: _ScreenUnits = ...,
895 pady: _ScreenUnits = ...,
896 relief: _Relief = ...,
897 screen: str = ..., # can't be changed after creating widget
898 takefocus: _TakeFocusValue = ...,
900 visual: str | tuple[str, int] = ...,
901 width: _ScreenUnits = ...,
906 cnf: dict[str, Any] | None = ...,
908 background: _Color = ...,
909 bd: _ScreenUnits = ...,
911 border: _ScreenUnits = ...,
912 borderwidth: _ScreenUnits = ...,
913 cursor: _Cursor = ...,
914 height: _ScreenUnits = ...,
915 highlightbackground: _Color = ...,
916 highlightcolor: _Color = ...,
917 highlightthickness: _ScreenUnits = ...,
919 padx: _ScreenUnits = ...,
920 pady: _ScreenUnits = ...,
921 relief: _Relief = ...,
922 takefocus: _TakeFocusValue = ...,
923 width: _ScreenUnits = ...,
924 ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
926 def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
929 class Button(Widget):
932 master: Misc | None = ...,
933 cnf: dict[str, Any] | None = ...,
935 activebackground: _Color = ...,
936 activeforeground: _Color = ...,
937 anchor: _Anchor = ...,
938 background: _Color = ...,
939 bd: _ScreenUnits = ..., # same as borderwidth
940 bg: _Color = ..., # same as background
941 bitmap: _Bitmap = ...,
942 border: _ScreenUnits = ..., # same as borderwidth
943 borderwidth: _ScreenUnits = ...,
944 command: _ButtonCommand = ...,
945 compound: _Compound = ...,
946 cursor: _Cursor = ...,
947 default: Literal["normal", "active", "disabled"] = ...,
948 disabledforeground: _Color = ...,
949 fg: _Color = ..., # same as foreground
950 font: _FontDescription = ...,
951 foreground: _Color = ...,
952 # width and height must be int for buttons containing just text, but
953 # ints are also valid _ScreenUnits
954 height: _ScreenUnits = ...,
955 highlightbackground: _Color = ...,
956 highlightcolor: _Color = ...,
957 highlightthickness: _ScreenUnits = ...,
958 image: _ImageSpec = ...,
959 justify: Literal["left", "center", "right"] = ...,
961 overrelief: _Relief = ...,
962 padx: _ScreenUnits = ...,
963 pady: _ScreenUnits = ...,
964 relief: _Relief = ...,
965 repeatdelay: int = ...,
966 repeatinterval: int = ...,
967 state: Literal["normal", "active", "disabled"] = ...,
968 takefocus: _TakeFocusValue = ...,
969 text: float | str = ...,
970 # We allow the textvariable to be any Variable, not necessarily
971 # StringVar. This is useful for e.g. a button that displays the value
973 textvariable: Variable = ...,
974 underline: int = ...,
975 width: _ScreenUnits = ...,
976 wraplength: _ScreenUnits = ...,
981 cnf: dict[str, Any] | None = ...,
983 activebackground: _Color = ...,
984 activeforeground: _Color = ...,
985 anchor: _Anchor = ...,
986 background: _Color = ...,
987 bd: _ScreenUnits = ...,
989 bitmap: _Bitmap = ...,
990 border: _ScreenUnits = ...,
991 borderwidth: _ScreenUnits = ...,
992 command: _ButtonCommand = ...,
993 compound: _Compound = ...,
994 cursor: _Cursor = ...,
995 default: Literal["normal", "active", "disabled"] = ...,
996 disabledforeground: _Color = ...,
998 font: _FontDescription = ...,
999 foreground: _Color = ...,
1000 height: _ScreenUnits = ...,
1001 highlightbackground: _Color = ...,
1002 highlightcolor: _Color = ...,
1003 highlightthickness: _ScreenUnits = ...,
1004 image: _ImageSpec = ...,
1005 justify: Literal["left", "center", "right"] = ...,
1006 overrelief: _Relief = ...,
1007 padx: _ScreenUnits = ...,
1008 pady: _ScreenUnits = ...,
1009 relief: _Relief = ...,
1010 repeatdelay: int = ...,
1011 repeatinterval: int = ...,
1012 state: Literal["normal", "active", "disabled"] = ...,
1013 takefocus: _TakeFocusValue = ...,
1014 text: float | str = ...,
1015 textvariable: Variable = ...,
1016 underline: int = ...,
1017 width: _ScreenUnits = ...,
1018 wraplength: _ScreenUnits = ...,
1019 ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
1021 def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
1023 def flash(self): ...
1024 def invoke(self) -> Any: ...
1026 class Canvas(Widget, XView, YView):
1029 master: Misc | None = ...,
1030 cnf: dict[str, Any] | None = ...,
1032 background: _Color = ...,
1033 bd: _ScreenUnits = ...,
1035 border: _ScreenUnits = ...,
1036 borderwidth: _ScreenUnits = ...,
1037 closeenough: float = ...,
1038 confine: bool = ...,
1039 cursor: _Cursor = ...,
1040 # canvas manual page has a section named COORDINATES, and the first
1041 # part of it describes _ScreenUnits.
1042 height: _ScreenUnits = ...,
1043 highlightbackground: _Color = ...,
1044 highlightcolor: _Color = ...,
1045 highlightthickness: _ScreenUnits = ...,
1046 insertbackground: _Color = ...,
1047 insertborderwidth: _ScreenUnits = ...,
1048 insertofftime: int = ...,
1049 insertontime: int = ...,
1050 insertwidth: _ScreenUnits = ...,
1052 offset: Any = ..., # undocumented
1053 relief: _Relief = ...,
1054 # Setting scrollregion to None doesn't reset it back to empty,
1055 # but setting it to () does.
1056 scrollregion: tuple[_ScreenUnits, _ScreenUnits, _ScreenUnits, _ScreenUnits] | tuple[()] = ...,
1057 selectbackground: _Color = ...,
1058 selectborderwidth: _ScreenUnits = ...,
1059 selectforeground: _Color = ...,
1060 # man page says that state can be 'hidden', but it can't
1061 state: Literal["normal", "disabled"] = ...,
1062 takefocus: _TakeFocusValue = ...,
1063 width: _ScreenUnits = ...,
1064 xscrollcommand: _XYScrollCommand = ...,
1065 xscrollincrement: _ScreenUnits = ...,
1066 yscrollcommand: _XYScrollCommand = ...,
1067 yscrollincrement: _ScreenUnits = ...,
1072 cnf: dict[str, Any] | None = ...,
1074 background: _Color = ...,
1075 bd: _ScreenUnits = ...,
1077 border: _ScreenUnits = ...,
1078 borderwidth: _ScreenUnits = ...,
1079 closeenough: float = ...,
1080 confine: bool = ...,
1081 cursor: _Cursor = ...,
1082 height: _ScreenUnits = ...,
1083 highlightbackground: _Color = ...,
1084 highlightcolor: _Color = ...,
1085 highlightthickness: _ScreenUnits = ...,
1086 insertbackground: _Color = ...,
1087 insertborderwidth: _ScreenUnits = ...,
1088 insertofftime: int = ...,
1089 insertontime: int = ...,
1090 insertwidth: _ScreenUnits = ...,
1091 offset: Any = ..., # undocumented
1092 relief: _Relief = ...,
1093 scrollregion: tuple[_ScreenUnits, _ScreenUnits, _ScreenUnits, _ScreenUnits] | tuple[()] = ...,
1094 selectbackground: _Color = ...,
1095 selectborderwidth: _ScreenUnits = ...,
1096 selectforeground: _Color = ...,
1097 state: Literal["normal", "disabled"] = ...,
1098 takefocus: _TakeFocusValue = ...,
1099 width: _ScreenUnits = ...,
1100 xscrollcommand: _XYScrollCommand = ...,
1101 xscrollincrement: _ScreenUnits = ...,
1102 yscrollcommand: _XYScrollCommand = ...,
1103 yscrollincrement: _ScreenUnits = ...,
1104 ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
1106 def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
1108 def addtag(self, *args): ... # internal method
1109 def addtag_above(self, newtag: str, tagOrId: str | _CanvasItemId) -> None: ...
1110 def addtag_all(self, newtag: str) -> None: ...
1111 def addtag_below(self, newtag: str, tagOrId: str | _CanvasItemId) -> None: ...
1117 halo: _ScreenUnits | None = ...,
1118 start: str | _CanvasItemId | None = ...,
1120 def addtag_enclosed(self, newtag: str, x1: _ScreenUnits, y1: _ScreenUnits, x2: _ScreenUnits, y2: _ScreenUnits) -> None: ...
1121 def addtag_overlapping(self, newtag: str, x1: _ScreenUnits, y1: _ScreenUnits, x2: _ScreenUnits, y2: _ScreenUnits) -> None: ...
1122 def addtag_withtag(self, newtag: str, tagOrId: str | _CanvasItemId) -> None: ...
1123 def find(self, *args): ... # internal method
1124 def find_above(self, tagOrId: str | _CanvasItemId) -> Tuple[_CanvasItemId, ...]: ...
1125 def find_all(self) -> Tuple[_CanvasItemId, ...]: ...
1126 def find_below(self, tagOrId: str | _CanvasItemId) -> Tuple[_CanvasItemId, ...]: ...
1128 self, x: _ScreenUnits, y: _ScreenUnits, halo: _ScreenUnits | None = ..., start: str | _CanvasItemId | None = ...
1129 ) -> Tuple[_CanvasItemId, ...]: ...
1131 self, x1: _ScreenUnits, y1: _ScreenUnits, x2: _ScreenUnits, y2: _ScreenUnits
1132 ) -> Tuple[_CanvasItemId, ...]: ...
1133 def find_overlapping(self, x1: _ScreenUnits, y1: _ScreenUnits, x2: _ScreenUnits, y2: float) -> Tuple[_CanvasItemId, ...]: ...
1134 def find_withtag(self, tagOrId: str | _CanvasItemId) -> Tuple[_CanvasItemId, ...]: ...
1135 # Canvas.bbox() args are `str | _CanvasItemId`, but mypy rejects that
1136 # description because it's incompatible with Misc.bbox(), an alias for
1137 # Misc.grid_bbox(). Yes it is, but there's not much we can do about it.
1138 def bbox(self, *args: str | _CanvasItemId) -> tuple[int, int, int, int]: ... # type: ignore
1143 sequence: str | None = ...,
1144 func: Callable[[Event[Canvas]], Any] | None = ...,
1145 add: Literal["", "+"] | bool | None = ...,
1149 self, tagOrId: str | int, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = ...
1152 def tag_bind(self, tagOrId: str | int, *, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ...
1153 def tag_unbind(self, tagOrId: str | int, sequence: str, funcid: str | None = ...) -> None: ...
1154 def canvasx(self, screenx, gridspacing: Any | None = ...): ...
1155 def canvasy(self, screeny, gridspacing: Any | None = ...): ...
1157 def coords(self) -> list[float]: ...
1159 def coords(self, __args: list[int] | list[float] | Tuple[float, ...]) -> None: ...
1161 def coords(self, __x1: float, __y1: float, *args: float) -> None: ...
1162 # create_foo() methods accept coords as a list, a tuple, or as separate arguments.
1163 # Keyword arguments should be the same in each pair of overloads.
1164 def create_arc(self, *args, **kw) -> _CanvasItemId: ...
1165 def create_bitmap(self, *args, **kw) -> _CanvasItemId: ...
1166 def create_image(self, *args, **kw) -> _CanvasItemId: ...
1175 activedash: str | list[int] | Tuple[int, ...] = ...,
1176 activefill: _Color = ...,
1177 activestipple: str = ...,
1178 activewidth: _ScreenUnits = ...,
1179 arrow: Literal["first", "last", "both"] = ...,
1180 arrowshape: tuple[float, float, float] = ...,
1181 capstyle: Literal["round", "projecting", "butt"] = ...,
1182 dash: str | list[int] | Tuple[int, ...] = ...,
1183 dashoffset: _ScreenUnits = ...,
1184 disableddash: str | list[int] | Tuple[int, ...] = ...,
1185 disabledfill: _Color = ...,
1186 disabledstipple: _Bitmap = ...,
1187 disabledwidth: _ScreenUnits = ...,
1189 joinstyle: Literal["round", "bevel", "miter"] = ...,
1190 offset: _ScreenUnits = ...,
1192 splinesteps: float = ...,
1193 state: Literal["normal", "active", "disabled"] = ...,
1194 stipple: _Bitmap = ...,
1195 tags: str | list[str] | Tuple[str, ...] = ...,
1196 width: _ScreenUnits = ...,
1197 ) -> _CanvasItemId: ...
1201 __coords: tuple[float, float, float, float] | list[int] | list[float],
1203 activedash: str | list[int] | Tuple[int, ...] = ...,
1204 activefill: _Color = ...,
1205 activestipple: str = ...,
1206 activewidth: _ScreenUnits = ...,
1207 arrow: Literal["first", "last", "both"] = ...,
1208 arrowshape: tuple[float, float, float] = ...,
1209 capstyle: Literal["round", "projecting", "butt"] = ...,
1210 dash: str | list[int] | Tuple[int, ...] = ...,
1211 dashoffset: _ScreenUnits = ...,
1212 disableddash: str | list[int] | Tuple[int, ...] = ...,
1213 disabledfill: _Color = ...,
1214 disabledstipple: _Bitmap = ...,
1215 disabledwidth: _ScreenUnits = ...,
1217 joinstyle: Literal["round", "bevel", "miter"] = ...,
1218 offset: _ScreenUnits = ...,
1220 splinesteps: float = ...,
1221 state: Literal["normal", "active", "disabled"] = ...,
1222 stipple: _Bitmap = ...,
1223 tags: str | list[str] | Tuple[str, ...] = ...,
1224 width: _ScreenUnits = ...,
1225 ) -> _CanvasItemId: ...
1234 activedash: str | list[int] | Tuple[int, ...] = ...,
1235 activefill: _Color = ...,
1236 activeoutline: _Color = ...,
1237 activeoutlinestipple: _Color = ...,
1238 activestipple: str = ...,
1239 activewidth: _ScreenUnits = ...,
1240 dash: str | list[int] | Tuple[int, ...] = ...,
1241 dashoffset: _ScreenUnits = ...,
1242 disableddash: str | list[int] | Tuple[int, ...] = ...,
1243 disabledfill: _Color = ...,
1244 disabledoutline: _Color = ...,
1245 disabledoutlinestipple: _Color = ...,
1246 disabledstipple: _Bitmap = ...,
1247 disabledwidth: _ScreenUnits = ...,
1249 offset: _ScreenUnits = ...,
1250 outline: _Color = ...,
1251 outlineoffset: _ScreenUnits = ...,
1252 outlinestipple: _Bitmap = ...,
1253 state: Literal["normal", "active", "disabled"] = ...,
1254 stipple: _Bitmap = ...,
1255 tags: str | list[str] | Tuple[str, ...] = ...,
1256 width: _ScreenUnits = ...,
1257 ) -> _CanvasItemId: ...
1261 __coords: tuple[float, float, float, float] | list[int] | list[float],
1263 activedash: str | list[int] | Tuple[int, ...] = ...,
1264 activefill: _Color = ...,
1265 activeoutline: _Color = ...,
1266 activeoutlinestipple: _Color = ...,
1267 activestipple: str = ...,
1268 activewidth: _ScreenUnits = ...,
1269 dash: str | list[int] | Tuple[int, ...] = ...,
1270 dashoffset: _ScreenUnits = ...,
1271 disableddash: str | list[int] | Tuple[int, ...] = ...,
1272 disabledfill: _Color = ...,
1273 disabledoutline: _Color = ...,
1274 disabledoutlinestipple: _Color = ...,
1275 disabledstipple: _Bitmap = ...,
1276 disabledwidth: _ScreenUnits = ...,
1278 offset: _ScreenUnits = ...,
1279 outline: _Color = ...,
1280 outlineoffset: _ScreenUnits = ...,
1281 outlinestipple: _Bitmap = ...,
1282 state: Literal["normal", "active", "disabled"] = ...,
1283 stipple: _Bitmap = ...,
1284 tags: str | list[str] | Tuple[str, ...] = ...,
1285 width: _ScreenUnits = ...,
1286 ) -> _CanvasItemId: ...
1295 activedash: str | list[int] | Tuple[int, ...] = ...,
1296 activefill: _Color = ...,
1297 activeoutline: _Color = ...,
1298 activeoutlinestipple: _Color = ...,
1299 activestipple: str = ...,
1300 activewidth: _ScreenUnits = ...,
1301 dash: str | list[int] | Tuple[int, ...] = ...,
1302 dashoffset: _ScreenUnits = ...,
1303 disableddash: str | list[int] | Tuple[int, ...] = ...,
1304 disabledfill: _Color = ...,
1305 disabledoutline: _Color = ...,
1306 disabledoutlinestipple: _Color = ...,
1307 disabledstipple: _Bitmap = ...,
1308 disabledwidth: _ScreenUnits = ...,
1310 joinstyle: Literal["round", "bevel", "miter"] = ...,
1311 offset: _ScreenUnits = ...,
1312 outline: _Color = ...,
1313 outlineoffset: _ScreenUnits = ...,
1314 outlinestipple: _Bitmap = ...,
1316 splinesteps: float = ...,
1317 state: Literal["normal", "active", "disabled"] = ...,
1318 stipple: _Bitmap = ...,
1319 tags: str | list[str] | Tuple[str, ...] = ...,
1320 width: _ScreenUnits = ...,
1321 ) -> _CanvasItemId: ...
1325 __coords: Tuple[float, ...] | list[int] | list[float],
1327 activedash: str | list[int] | Tuple[int, ...] = ...,
1328 activefill: _Color = ...,
1329 activeoutline: _Color = ...,
1330 activeoutlinestipple: _Color = ...,
1331 activestipple: str = ...,
1332 activewidth: _ScreenUnits = ...,
1333 dash: str | list[int] | Tuple[int, ...] = ...,
1334 dashoffset: _ScreenUnits = ...,
1335 disableddash: str | list[int] | Tuple[int, ...] = ...,
1336 disabledfill: _Color = ...,
1337 disabledoutline: _Color = ...,
1338 disabledoutlinestipple: _Color = ...,
1339 disabledstipple: _Bitmap = ...,
1340 disabledwidth: _ScreenUnits = ...,
1342 joinstyle: Literal["round", "bevel", "miter"] = ...,
1343 offset: _ScreenUnits = ...,
1344 outline: _Color = ...,
1345 outlineoffset: _ScreenUnits = ...,
1346 outlinestipple: _Bitmap = ...,
1348 splinesteps: float = ...,
1349 state: Literal["normal", "active", "disabled"] = ...,
1350 stipple: _Bitmap = ...,
1351 tags: str | list[str] | Tuple[str, ...] = ...,
1352 width: _ScreenUnits = ...,
1353 ) -> _CanvasItemId: ...
1355 def create_rectangle(
1362 activedash: str | list[int] | Tuple[int, ...] = ...,
1363 activefill: _Color = ...,
1364 activeoutline: _Color = ...,
1365 activeoutlinestipple: _Color = ...,
1366 activestipple: str = ...,
1367 activewidth: _ScreenUnits = ...,
1368 dash: str | list[int] | Tuple[int, ...] = ...,
1369 dashoffset: _ScreenUnits = ...,
1370 disableddash: str | list[int] | Tuple[int, ...] = ...,
1371 disabledfill: _Color = ...,
1372 disabledoutline: _Color = ...,
1373 disabledoutlinestipple: _Color = ...,
1374 disabledstipple: _Bitmap = ...,
1375 disabledwidth: _ScreenUnits = ...,
1377 offset: _ScreenUnits = ...,
1378 outline: _Color = ...,
1379 outlineoffset: _ScreenUnits = ...,
1380 outlinestipple: _Bitmap = ...,
1381 state: Literal["normal", "active", "disabled"] = ...,
1382 stipple: _Bitmap = ...,
1383 tags: str | list[str] | Tuple[str, ...] = ...,
1384 width: _ScreenUnits = ...,
1385 ) -> _CanvasItemId: ...
1387 def create_rectangle(
1389 __coords: tuple[float, float, float, float] | list[int] | list[float],
1391 activedash: str | list[int] | Tuple[int, ...] = ...,
1392 activefill: _Color = ...,
1393 activeoutline: _Color = ...,
1394 activeoutlinestipple: _Color = ...,
1395 activestipple: str = ...,
1396 activewidth: _ScreenUnits = ...,
1397 dash: str | list[int] | Tuple[int, ...] = ...,
1398 dashoffset: _ScreenUnits = ...,
1399 disableddash: str | list[int] | Tuple[int, ...] = ...,
1400 disabledfill: _Color = ...,
1401 disabledoutline: _Color = ...,
1402 disabledoutlinestipple: _Color = ...,
1403 disabledstipple: _Bitmap = ...,
1404 disabledwidth: _ScreenUnits = ...,
1406 offset: _ScreenUnits = ...,
1407 outline: _Color = ...,
1408 outlineoffset: _ScreenUnits = ...,
1409 outlinestipple: _Bitmap = ...,
1410 state: Literal["normal", "active", "disabled"] = ...,
1411 stipple: _Bitmap = ...,
1412 tags: str | list[str] | Tuple[str, ...] = ...,
1413 width: _ScreenUnits = ...,
1414 ) -> _CanvasItemId: ...
1421 activefill: _Color = ...,
1422 activestipple: str = ...,
1423 anchor: _Anchor = ...,
1424 disabledfill: _Color = ...,
1425 disabledstipple: _Bitmap = ...,
1427 font: _FontDescription = ...,
1428 justify: Literal["left", "center", "right"] = ...,
1429 offset: _ScreenUnits = ...,
1430 state: Literal["normal", "active", "disabled"] = ...,
1431 stipple: _Bitmap = ...,
1432 tags: str | list[str] | Tuple[str, ...] = ...,
1433 text: float | str = ...,
1434 width: _ScreenUnits = ...,
1435 ) -> _CanvasItemId: ...
1439 __coords: tuple[float, float] | list[int] | list[float],
1441 activefill: _Color = ...,
1442 activestipple: str = ...,
1443 anchor: _Anchor = ...,
1444 disabledfill: _Color = ...,
1445 disabledstipple: _Bitmap = ...,
1447 font: _FontDescription = ...,
1448 justify: Literal["left", "center", "right"] = ...,
1449 offset: _ScreenUnits = ...,
1450 state: Literal["normal", "active", "disabled"] = ...,
1451 stipple: _Bitmap = ...,
1452 tags: str | list[str] | Tuple[str, ...] = ...,
1453 text: float | str = ...,
1454 width: _ScreenUnits = ...,
1455 ) -> _CanvasItemId: ...
1462 anchor: _Anchor = ...,
1463 height: _ScreenUnits = ...,
1464 state: Literal["normal", "active", "disabled"] = ...,
1465 tags: str | list[str] | Tuple[str, ...] = ...,
1466 width: _ScreenUnits = ...,
1467 window: Widget = ...,
1468 ) -> _CanvasItemId: ...
1472 __coords: tuple[float, float] | list[int] | list[float],
1474 anchor: _Anchor = ...,
1475 height: _ScreenUnits = ...,
1476 state: Literal["normal", "active", "disabled"] = ...,
1477 tags: str | list[str] | Tuple[str, ...] = ...,
1478 width: _ScreenUnits = ...,
1479 window: Widget = ...,
1480 ) -> _CanvasItemId: ...
1481 def dchars(self, *args): ...
1482 def delete(self, *tagsOrCanvasIds: str | _CanvasItemId) -> None: ...
1484 def dtag(self, __tag: str, __tag_to_delete: str | None = ...) -> None: ...
1486 def dtag(self, __id: _CanvasItemId, __tag_to_delete: str) -> None: ...
1487 def focus(self, *args): ...
1488 def gettags(self, __tagOrId: str | _CanvasItemId) -> Tuple[str, ...]: ...
1489 def icursor(self, *args): ...
1490 def index(self, *args): ...
1491 def insert(self, *args): ...
1492 def itemcget(self, tagOrId, option): ...
1493 # itemconfigure kwargs depend on item type, which is not known when type checking
1495 self, tagOrId: str | _CanvasItemId, cnf: dict[str, Any] | None = ..., **kw: Any
1496 ) -> dict[str, tuple[str, str, str, str, str]] | None: ...
1497 itemconfig = itemconfigure
1498 def move(self, *args): ...
1499 if sys.version_info >= (3, 8):
1500 def moveto(self, tagOrId: str | _CanvasItemId, x: Literal[""] | float = ..., y: Literal[""] | float = ...) -> None: ...
1501 def postscript(self, cnf=..., **kw): ...
1504 # lift = tkraise = tag_raise
1506 # But mypy doesn't like aliasing here (maybe because Misc defines the same names)
1507 def tag_lower(self, __first: str | _CanvasItemId, __second: str | _CanvasItemId | None = ...) -> None: ...
1508 def lower(self, __first: str | _CanvasItemId, __second: str | _CanvasItemId | None = ...) -> None: ... # type: ignore
1509 def tag_raise(self, __first: str | _CanvasItemId, __second: str | _CanvasItemId | None = ...) -> None: ...
1510 def tkraise(self, __first: str | _CanvasItemId, __second: str | _CanvasItemId | None = ...) -> None: ... # type: ignore
1511 def lift(self, __first: str | _CanvasItemId, __second: str | _CanvasItemId | None = ...) -> None: ... # type: ignore
1512 def scale(self, *args): ...
1513 def scan_mark(self, x, y): ...
1514 def scan_dragto(self, x, y, gain: int = ...): ...
1515 def select_adjust(self, tagOrId, index): ...
1516 def select_clear(self): ...
1517 def select_from(self, tagOrId, index): ...
1518 def select_item(self): ...
1519 def select_to(self, tagOrId, index): ...
1520 def type(self, tagOrId): ...
1522 class Checkbutton(Widget):
1525 master: Misc | None = ...,
1526 cnf: dict[str, Any] | None = ...,
1528 activebackground: _Color = ...,
1529 activeforeground: _Color = ...,
1530 anchor: _Anchor = ...,
1531 background: _Color = ...,
1532 bd: _ScreenUnits = ...,
1534 bitmap: _Bitmap = ...,
1535 border: _ScreenUnits = ...,
1536 borderwidth: _ScreenUnits = ...,
1537 command: _ButtonCommand = ...,
1538 compound: _Compound = ...,
1539 cursor: _Cursor = ...,
1540 disabledforeground: _Color = ...,
1542 font: _FontDescription = ...,
1543 foreground: _Color = ...,
1544 height: _ScreenUnits = ...,
1545 highlightbackground: _Color = ...,
1546 highlightcolor: _Color = ...,
1547 highlightthickness: _ScreenUnits = ...,
1548 image: _ImageSpec = ...,
1549 indicatoron: bool = ...,
1550 justify: Literal["left", "center", "right"] = ...,
1552 offrelief: _Relief = ...,
1553 # The checkbutton puts a value to its variable when it's checked or
1554 # unchecked. We don't restrict the type of that value here, so
1555 # Any-typing is fine.
1557 # I think Checkbutton shouldn't be generic, because then specifying
1558 # "any checkbutton regardless of what variable it uses" would be
1559 # difficult, and we might run into issues just like how list[float]
1560 # and list[int] are incompatible. Also, we would need a way to
1561 # specify "Checkbutton not associated with any variable", which is
1562 # done by setting variable to empty string (the default).
1563 offvalue: Any = ...,
1565 overrelief: _Relief = ...,
1566 padx: _ScreenUnits = ...,
1567 pady: _ScreenUnits = ...,
1568 relief: _Relief = ...,
1569 selectcolor: _Color = ...,
1570 selectimage: _ImageSpec = ...,
1571 state: Literal["normal", "active", "disabled"] = ...,
1572 takefocus: _TakeFocusValue = ...,
1573 text: float | str = ...,
1574 textvariable: Variable = ...,
1575 tristateimage: _ImageSpec = ...,
1576 tristatevalue: Any = ...,
1577 underline: int = ...,
1578 variable: Variable | Literal[""] = ...,
1579 width: _ScreenUnits = ...,
1580 wraplength: _ScreenUnits = ...,
1585 cnf: dict[str, Any] | None = ...,
1587 activebackground: _Color = ...,
1588 activeforeground: _Color = ...,
1589 anchor: _Anchor = ...,
1590 background: _Color = ...,
1591 bd: _ScreenUnits = ...,
1593 bitmap: _Bitmap = ...,
1594 border: _ScreenUnits = ...,
1595 borderwidth: _ScreenUnits = ...,
1596 command: _ButtonCommand = ...,
1597 compound: _Compound = ...,
1598 cursor: _Cursor = ...,
1599 disabledforeground: _Color = ...,
1601 font: _FontDescription = ...,
1602 foreground: _Color = ...,
1603 height: _ScreenUnits = ...,
1604 highlightbackground: _Color = ...,
1605 highlightcolor: _Color = ...,
1606 highlightthickness: _ScreenUnits = ...,
1607 image: _ImageSpec = ...,
1608 indicatoron: bool = ...,
1609 justify: Literal["left", "center", "right"] = ...,
1610 offrelief: _Relief = ...,
1611 offvalue: Any = ...,
1613 overrelief: _Relief = ...,
1614 padx: _ScreenUnits = ...,
1615 pady: _ScreenUnits = ...,
1616 relief: _Relief = ...,
1617 selectcolor: _Color = ...,
1618 selectimage: _ImageSpec = ...,
1619 state: Literal["normal", "active", "disabled"] = ...,
1620 takefocus: _TakeFocusValue = ...,
1621 text: float | str = ...,
1622 textvariable: Variable = ...,
1623 tristateimage: _ImageSpec = ...,
1624 tristatevalue: Any = ...,
1625 underline: int = ...,
1626 variable: Variable | Literal[""] = ...,
1627 width: _ScreenUnits = ...,
1628 wraplength: _ScreenUnits = ...,
1629 ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
1631 def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
1633 def deselect(self): ...
1634 def flash(self): ...
1635 def invoke(self) -> Any: ...
1636 def select(self): ...
1637 def toggle(self): ...
1639 _EntryIndex = Union[str, int] # "INDICES" in manual page
1641 class Entry(Widget, XView):
1644 master: Misc | None = ...,
1645 cnf: dict[str, Any] | None = ...,
1647 background: _Color = ...,
1648 bd: _ScreenUnits = ...,
1650 border: _ScreenUnits = ...,
1651 borderwidth: _ScreenUnits = ...,
1652 cursor: _Cursor = ...,
1653 disabledbackground: _Color = ...,
1654 disabledforeground: _Color = ...,
1655 exportselection: bool = ...,
1657 font: _FontDescription = ...,
1658 foreground: _Color = ...,
1659 highlightbackground: _Color = ...,
1660 highlightcolor: _Color = ...,
1661 highlightthickness: _ScreenUnits = ...,
1662 insertbackground: _Color = ...,
1663 insertborderwidth: _ScreenUnits = ...,
1664 insertofftime: int = ...,
1665 insertontime: int = ...,
1666 insertwidth: _ScreenUnits = ...,
1667 invalidcommand: _EntryValidateCommand = ...,
1668 invcmd: _EntryValidateCommand = ..., # same as invalidcommand
1669 justify: Literal["left", "center", "right"] = ...,
1671 readonlybackground: _Color = ...,
1672 relief: _Relief = ...,
1673 selectbackground: _Color = ...,
1674 selectborderwidth: _ScreenUnits = ...,
1675 selectforeground: _Color = ...,
1677 state: Literal["normal", "disabled", "readonly"] = ...,
1678 takefocus: _TakeFocusValue = ...,
1679 textvariable: Variable = ...,
1680 validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ...,
1681 validatecommand: _EntryValidateCommand = ...,
1682 vcmd: _EntryValidateCommand = ..., # same as validatecommand
1684 xscrollcommand: _XYScrollCommand = ...,
1689 cnf: dict[str, Any] | None = ...,
1691 background: _Color = ...,
1692 bd: _ScreenUnits = ...,
1694 border: _ScreenUnits = ...,
1695 borderwidth: _ScreenUnits = ...,
1696 cursor: _Cursor = ...,
1697 disabledbackground: _Color = ...,
1698 disabledforeground: _Color = ...,
1699 exportselection: bool = ...,
1701 font: _FontDescription = ...,
1702 foreground: _Color = ...,
1703 highlightbackground: _Color = ...,
1704 highlightcolor: _Color = ...,
1705 highlightthickness: _ScreenUnits = ...,
1706 insertbackground: _Color = ...,
1707 insertborderwidth: _ScreenUnits = ...,
1708 insertofftime: int = ...,
1709 insertontime: int = ...,
1710 insertwidth: _ScreenUnits = ...,
1711 invalidcommand: _EntryValidateCommand = ...,
1712 invcmd: _EntryValidateCommand = ...,
1713 justify: Literal["left", "center", "right"] = ...,
1714 readonlybackground: _Color = ...,
1715 relief: _Relief = ...,
1716 selectbackground: _Color = ...,
1717 selectborderwidth: _ScreenUnits = ...,
1718 selectforeground: _Color = ...,
1720 state: Literal["normal", "disabled", "readonly"] = ...,
1721 takefocus: _TakeFocusValue = ...,
1722 textvariable: Variable = ...,
1723 validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ...,
1724 validatecommand: _EntryValidateCommand = ...,
1725 vcmd: _EntryValidateCommand = ...,
1727 xscrollcommand: _XYScrollCommand = ...,
1728 ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
1730 def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
1732 def delete(self, first: _EntryIndex, last: _EntryIndex | None = ...) -> None: ...
1733 def get(self) -> str: ...
1734 def icursor(self, index: _EntryIndex) -> None: ...
1735 def index(self, index: _EntryIndex) -> int: ...
1736 def insert(self, index: _EntryIndex, string: str) -> None: ...
1737 def scan_mark(self, x): ...
1738 def scan_dragto(self, x): ...
1739 def selection_adjust(self, index: _EntryIndex) -> None: ...
1740 def selection_clear(self) -> None: ... # type: ignore
1741 def selection_from(self, index: _EntryIndex) -> None: ...
1742 def selection_present(self) -> bool: ...
1743 def selection_range(self, start: _EntryIndex, end: _EntryIndex) -> None: ...
1744 def selection_to(self, index: _EntryIndex) -> None: ...
1745 select_adjust = selection_adjust
1746 select_clear = selection_clear
1747 select_from = selection_from
1748 select_present = selection_present
1749 select_range = selection_range
1750 select_to = selection_to
1752 class Frame(Widget):
1755 master: Misc | None = ...,
1756 cnf: dict[str, Any] | None = ...,
1758 background: _Color = ...,
1759 bd: _ScreenUnits = ...,
1761 border: _ScreenUnits = ...,
1762 borderwidth: _ScreenUnits = ...,
1764 colormap: Literal["new", ""] | Misc = ...,
1765 container: bool = ...,
1766 cursor: _Cursor = ...,
1767 height: _ScreenUnits = ...,
1768 highlightbackground: _Color = ...,
1769 highlightcolor: _Color = ...,
1770 highlightthickness: _ScreenUnits = ...,
1772 padx: _ScreenUnits = ...,
1773 pady: _ScreenUnits = ...,
1774 relief: _Relief = ...,
1775 takefocus: _TakeFocusValue = ...,
1776 visual: str | tuple[str, int] = ...,
1777 width: _ScreenUnits = ...,
1782 cnf: dict[str, Any] | None = ...,
1784 background: _Color = ...,
1785 bd: _ScreenUnits = ...,
1787 border: _ScreenUnits = ...,
1788 borderwidth: _ScreenUnits = ...,
1789 cursor: _Cursor = ...,
1790 height: _ScreenUnits = ...,
1791 highlightbackground: _Color = ...,
1792 highlightcolor: _Color = ...,
1793 highlightthickness: _ScreenUnits = ...,
1794 padx: _ScreenUnits = ...,
1795 pady: _ScreenUnits = ...,
1796 relief: _Relief = ...,
1797 takefocus: _TakeFocusValue = ...,
1798 width: _ScreenUnits = ...,
1799 ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
1801 def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
1804 class Label(Widget):
1807 master: Misc | None = ...,
1808 cnf: dict[str, Any] | None = ...,
1810 activebackground: _Color = ...,
1811 activeforeground: _Color = ...,
1812 anchor: _Anchor = ...,
1813 background: _Color = ...,
1814 bd: _ScreenUnits = ...,
1816 bitmap: _Bitmap = ...,
1817 border: _ScreenUnits = ...,
1818 borderwidth: _ScreenUnits = ...,
1819 compound: _Compound = ...,
1820 cursor: _Cursor = ...,
1821 disabledforeground: _Color = ...,
1823 font: _FontDescription = ...,
1824 foreground: _Color = ...,
1825 height: _ScreenUnits = ...,
1826 highlightbackground: _Color = ...,
1827 highlightcolor: _Color = ...,
1828 highlightthickness: _ScreenUnits = ...,
1829 image: _ImageSpec = ...,
1830 justify: Literal["left", "center", "right"] = ...,
1832 padx: _ScreenUnits = ...,
1833 pady: _ScreenUnits = ...,
1834 relief: _Relief = ...,
1835 state: Literal["normal", "active", "disabled"] = ...,
1836 takefocus: _TakeFocusValue = ...,
1837 text: float | str = ...,
1838 textvariable: Variable = ...,
1839 underline: int = ...,
1840 width: _ScreenUnits = ...,
1841 wraplength: _ScreenUnits = ...,
1846 cnf: dict[str, Any] | None = ...,
1848 activebackground: _Color = ...,
1849 activeforeground: _Color = ...,
1850 anchor: _Anchor = ...,
1851 background: _Color = ...,
1852 bd: _ScreenUnits = ...,
1854 bitmap: _Bitmap = ...,
1855 border: _ScreenUnits = ...,
1856 borderwidth: _ScreenUnits = ...,
1857 compound: _Compound = ...,
1858 cursor: _Cursor = ...,
1859 disabledforeground: _Color = ...,
1861 font: _FontDescription = ...,
1862 foreground: _Color = ...,
1863 height: _ScreenUnits = ...,
1864 highlightbackground: _Color = ...,
1865 highlightcolor: _Color = ...,
1866 highlightthickness: _ScreenUnits = ...,
1867 image: _ImageSpec = ...,
1868 justify: Literal["left", "center", "right"] = ...,
1869 padx: _ScreenUnits = ...,
1870 pady: _ScreenUnits = ...,
1871 relief: _Relief = ...,
1872 state: Literal["normal", "active", "disabled"] = ...,
1873 takefocus: _TakeFocusValue = ...,
1874 text: float | str = ...,
1875 textvariable: Variable = ...,
1876 underline: int = ...,
1877 width: _ScreenUnits = ...,
1878 wraplength: _ScreenUnits = ...,
1879 ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
1881 def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
1884 class Listbox(Widget, XView, YView):
1887 master: Misc | None = ...,
1888 cnf: dict[str, Any] | None = ...,
1890 activestyle: Literal["dotbox", "none", "underline"] = ...,
1891 background: _Color = ...,
1892 bd: _ScreenUnits = ...,
1894 border: _ScreenUnits = ...,
1895 borderwidth: _ScreenUnits = ...,
1896 cursor: _Cursor = ...,
1897 disabledforeground: _Color = ...,
1898 exportselection: int = ...,
1900 font: _FontDescription = ...,
1901 foreground: _Color = ...,
1903 highlightbackground: _Color = ...,
1904 highlightcolor: _Color = ...,
1905 highlightthickness: _ScreenUnits = ...,
1906 justify: Literal["left", "center", "right"] = ...,
1907 # There's no tkinter.ListVar, but seems like bare tkinter.Variable
1908 # actually works for this:
1910 # >>> import tkinter
1911 # >>> lb = tkinter.Listbox()
1912 # >>> var = lb['listvariable'] = tkinter.Variable()
1913 # >>> var.set(['foo', 'bar', 'baz'])
1914 # >>> lb.get(0, 'end')
1915 # ('foo', 'bar', 'baz')
1916 listvariable: Variable = ...,
1918 relief: _Relief = ...,
1919 selectbackground: _Color = ...,
1920 selectborderwidth: _ScreenUnits = ...,
1921 selectforeground: _Color = ...,
1922 # from listbox man page: "The value of the [selectmode] option may be
1923 # arbitrary, but the default bindings expect it to be ..."
1925 # I have never seen anyone setting this to something else than what
1926 # "the default bindings expect", but let's support it anyway.
1927 selectmode: str = ...,
1928 setgrid: bool = ...,
1929 state: Literal["normal", "disabled"] = ...,
1930 takefocus: _TakeFocusValue = ...,
1932 xscrollcommand: _XYScrollCommand = ...,
1933 yscrollcommand: _XYScrollCommand = ...,
1938 cnf: dict[str, Any] | None = ...,
1940 activestyle: Literal["dotbox", "none", "underline"] = ...,
1941 background: _Color = ...,
1942 bd: _ScreenUnits = ...,
1944 border: _ScreenUnits = ...,
1945 borderwidth: _ScreenUnits = ...,
1946 cursor: _Cursor = ...,
1947 disabledforeground: _Color = ...,
1948 exportselection: bool = ...,
1950 font: _FontDescription = ...,
1951 foreground: _Color = ...,
1953 highlightbackground: _Color = ...,
1954 highlightcolor: _Color = ...,
1955 highlightthickness: _ScreenUnits = ...,
1956 justify: Literal["left", "center", "right"] = ...,
1957 listvariable: Variable = ...,
1958 relief: _Relief = ...,
1959 selectbackground: _Color = ...,
1960 selectborderwidth: _ScreenUnits = ...,
1961 selectforeground: _Color = ...,
1962 selectmode: str = ...,
1963 setgrid: bool = ...,
1964 state: Literal["normal", "disabled"] = ...,
1965 takefocus: _TakeFocusValue = ...,
1967 xscrollcommand: _XYScrollCommand = ...,
1968 yscrollcommand: _XYScrollCommand = ...,
1969 ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
1971 def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
1973 def activate(self, index): ...
1974 def bbox(self, index): ...
1975 def curselection(self): ...
1976 def delete(self, first, last: Any | None = ...): ...
1977 def get(self, first, last: Any | None = ...): ...
1978 def index(self, index): ...
1979 def insert(self, index, *elements): ...
1980 def nearest(self, y): ...
1981 def scan_mark(self, x, y): ...
1982 def scan_dragto(self, x, y): ...
1983 def see(self, index): ...
1984 def selection_anchor(self, index): ...
1986 def selection_clear(self, first, last: Any | None = ...): ... # type: ignore
1988 def selection_includes(self, index): ...
1989 select_includes: Any
1990 def selection_set(self, first, last: Any | None = ...): ...
1993 def itemcget(self, index, option): ...
1994 def itemconfigure(self, index, cnf: Any | None = ..., **kw): ...
1997 _MenuIndex = Union[str, int]
2002 master: Misc | None = ...,
2003 cnf: dict[str, Any] | None = ...,
2005 activebackground: _Color = ...,
2006 activeborderwidth: _ScreenUnits = ...,
2007 activeforeground: _Color = ...,
2008 background: _Color = ...,
2009 bd: _ScreenUnits = ...,
2011 border: _ScreenUnits = ...,
2012 borderwidth: _ScreenUnits = ...,
2013 cursor: _Cursor = ...,
2014 disabledforeground: _Color = ...,
2016 font: _FontDescription = ...,
2017 foreground: _Color = ...,
2019 postcommand: Callable[[], Any] | str = ...,
2020 relief: _Relief = ...,
2021 selectcolor: _Color = ...,
2022 takefocus: _TakeFocusValue = ...,
2024 # I guess tearoffcommand arguments are supposed to be widget objects,
2025 # but they are widget name strings. Use nametowidget() to handle the
2026 # arguments of tearoffcommand.
2027 tearoffcommand: Callable[[str, str], Any] | str = ...,
2029 type: Literal["menubar", "tearoff", "normal"] = ...,
2034 cnf: dict[str, Any] | None = ...,
2036 activebackground: _Color = ...,
2037 activeborderwidth: _ScreenUnits = ...,
2038 activeforeground: _Color = ...,
2039 background: _Color = ...,
2040 bd: _ScreenUnits = ...,
2042 border: _ScreenUnits = ...,
2043 borderwidth: _ScreenUnits = ...,
2044 cursor: _Cursor = ...,
2045 disabledforeground: _Color = ...,
2047 font: _FontDescription = ...,
2048 foreground: _Color = ...,
2049 postcommand: Callable[[], Any] | str = ...,
2050 relief: _Relief = ...,
2051 selectcolor: _Color = ...,
2052 takefocus: _TakeFocusValue = ...,
2053 tearoff: bool = ...,
2054 tearoffcommand: Callable[[str, str], Any] | str = ...,
2056 type: Literal["menubar", "tearoff", "normal"] = ...,
2057 ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
2059 def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
2061 def tk_popup(self, x: int, y: int, entry: _MenuIndex = ...) -> None: ...
2062 def activate(self, index: _MenuIndex) -> None: ...
2063 def add(self, itemType, cnf=..., **kw): ... # docstring says "Internal function."
2064 def insert(self, index, itemType, cnf=..., **kw): ... # docstring says "Internal function."
2067 cnf: dict[str, Any] | None = ...,
2069 accelerator: str = ...,
2070 activebackground: _Color = ...,
2071 activeforeground: _Color = ...,
2072 background: _Color = ...,
2073 bitmap: _Bitmap = ...,
2074 columnbreak: int = ...,
2075 command: Callable[[], Any] | str = ...,
2076 compound: _Compound = ...,
2077 font: _FontDescription = ...,
2078 foreground: _Color = ...,
2079 hidemargin: bool = ...,
2080 image: _ImageSpec = ...,
2083 state: Literal["normal", "active", "disabled"] = ...,
2084 underline: int = ...,
2086 def add_checkbutton(
2088 cnf: dict[str, Any] | None = ...,
2090 accelerator: str = ...,
2091 activebackground: _Color = ...,
2092 activeforeground: _Color = ...,
2093 background: _Color = ...,
2094 bitmap: _Bitmap = ...,
2095 columnbreak: int = ...,
2096 command: Callable[[], Any] | str = ...,
2097 compound: _Compound = ...,
2098 font: _FontDescription = ...,
2099 foreground: _Color = ...,
2100 hidemargin: bool = ...,
2101 image: _ImageSpec = ...,
2102 indicatoron: bool = ...,
2104 offvalue: Any = ...,
2106 selectcolor: _Color = ...,
2107 selectimage: _ImageSpec = ...,
2108 state: Literal["normal", "active", "disabled"] = ...,
2109 underline: int = ...,
2110 variable: Variable = ...,
2114 cnf: dict[str, Any] | None = ...,
2116 accelerator: str = ...,
2117 activebackground: _Color = ...,
2118 activeforeground: _Color = ...,
2119 background: _Color = ...,
2120 bitmap: _Bitmap = ...,
2121 columnbreak: int = ...,
2122 command: Callable[[], Any] | str = ...,
2123 compound: _Compound = ...,
2124 font: _FontDescription = ...,
2125 foreground: _Color = ...,
2126 hidemargin: bool = ...,
2127 image: _ImageSpec = ...,
2129 state: Literal["normal", "active", "disabled"] = ...,
2130 underline: int = ...,
2132 def add_radiobutton(
2134 cnf: dict[str, Any] | None = ...,
2136 accelerator: str = ...,
2137 activebackground: _Color = ...,
2138 activeforeground: _Color = ...,
2139 background: _Color = ...,
2140 bitmap: _Bitmap = ...,
2141 columnbreak: int = ...,
2142 command: Callable[[], Any] | str = ...,
2143 compound: _Compound = ...,
2144 font: _FontDescription = ...,
2145 foreground: _Color = ...,
2146 hidemargin: bool = ...,
2147 image: _ImageSpec = ...,
2148 indicatoron: bool = ...,
2150 selectcolor: _Color = ...,
2151 selectimage: _ImageSpec = ...,
2152 state: Literal["normal", "active", "disabled"] = ...,
2153 underline: int = ...,
2155 variable: Variable = ...,
2157 def add_separator(self, cnf: dict[str, Any] | None = ..., *, background: _Color = ...) -> None: ...
2161 cnf: dict[str, Any] | None = ...,
2163 accelerator: str = ...,
2164 activebackground: _Color = ...,
2165 activeforeground: _Color = ...,
2166 background: _Color = ...,
2167 bitmap: _Bitmap = ...,
2168 columnbreak: int = ...,
2169 command: Callable[[], Any] | str = ...,
2170 compound: _Compound = ...,
2171 font: _FontDescription = ...,
2172 foreground: _Color = ...,
2173 hidemargin: bool = ...,
2174 image: _ImageSpec = ...,
2177 state: Literal["normal", "active", "disabled"] = ...,
2178 underline: int = ...,
2180 def insert_checkbutton(
2183 cnf: dict[str, Any] | None = ...,
2185 accelerator: str = ...,
2186 activebackground: _Color = ...,
2187 activeforeground: _Color = ...,
2188 background: _Color = ...,
2189 bitmap: _Bitmap = ...,
2190 columnbreak: int = ...,
2191 command: Callable[[], Any] | str = ...,
2192 compound: _Compound = ...,
2193 font: _FontDescription = ...,
2194 foreground: _Color = ...,
2195 hidemargin: bool = ...,
2196 image: _ImageSpec = ...,
2197 indicatoron: bool = ...,
2199 offvalue: Any = ...,
2201 selectcolor: _Color = ...,
2202 selectimage: _ImageSpec = ...,
2203 state: Literal["normal", "active", "disabled"] = ...,
2204 underline: int = ...,
2205 variable: Variable = ...,
2210 cnf: dict[str, Any] | None = ...,
2212 accelerator: str = ...,
2213 activebackground: _Color = ...,
2214 activeforeground: _Color = ...,
2215 background: _Color = ...,
2216 bitmap: _Bitmap = ...,
2217 columnbreak: int = ...,
2218 command: Callable[[], Any] | str = ...,
2219 compound: _Compound = ...,
2220 font: _FontDescription = ...,
2221 foreground: _Color = ...,
2222 hidemargin: bool = ...,
2223 image: _ImageSpec = ...,
2225 state: Literal["normal", "active", "disabled"] = ...,
2226 underline: int = ...,
2228 def insert_radiobutton(
2231 cnf: dict[str, Any] | None = ...,
2233 accelerator: str = ...,
2234 activebackground: _Color = ...,
2235 activeforeground: _Color = ...,
2236 background: _Color = ...,
2237 bitmap: _Bitmap = ...,
2238 columnbreak: int = ...,
2239 command: Callable[[], Any] | str = ...,
2240 compound: _Compound = ...,
2241 font: _FontDescription = ...,
2242 foreground: _Color = ...,
2243 hidemargin: bool = ...,
2244 image: _ImageSpec = ...,
2245 indicatoron: bool = ...,
2247 selectcolor: _Color = ...,
2248 selectimage: _ImageSpec = ...,
2249 state: Literal["normal", "active", "disabled"] = ...,
2250 underline: int = ...,
2252 variable: Variable = ...,
2254 def insert_separator(self, index: _MenuIndex, cnf: dict[str, Any] | None = ..., *, background: _Color = ...) -> None: ...
2255 def delete(self, index1: _MenuIndex, index2: _MenuIndex | None = ...) -> None: ...
2256 def entrycget(self, index: _MenuIndex, option: str) -> Any: ...
2258 self, index: _MenuIndex, cnf: dict[str, Any] | None = ..., **kw: Any
2259 ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
2260 entryconfig = entryconfigure
2261 def index(self, index: _MenuIndex) -> int | None: ...
2262 def invoke(self, index: _MenuIndex) -> Any: ...
2263 def post(self, x: int, y: int) -> None: ...
2264 def type(self, index: _MenuIndex) -> Literal["cascade", "checkbutton", "command", "radiobutton", "separator"]: ...
2265 def unpost(self) -> None: ...
2266 def xposition(self, index: _MenuIndex) -> int: ...
2267 def yposition(self, index: _MenuIndex) -> int: ...
2269 class Menubutton(Widget):
2272 master: Misc | None = ...,
2273 cnf: dict[str, Any] | None = ...,
2275 activebackground: _Color = ...,
2276 activeforeground: _Color = ...,
2277 anchor: _Anchor = ...,
2278 background: _Color = ...,
2279 bd: _ScreenUnits = ...,
2281 bitmap: _Bitmap = ...,
2282 border: _ScreenUnits = ...,
2283 borderwidth: _ScreenUnits = ...,
2284 compound: _Compound = ...,
2285 cursor: _Cursor = ...,
2286 direction: Literal["above", "below", "left", "right", "flush"] = ...,
2287 disabledforeground: _Color = ...,
2289 font: _FontDescription = ...,
2290 foreground: _Color = ...,
2291 height: _ScreenUnits = ...,
2292 highlightbackground: _Color = ...,
2293 highlightcolor: _Color = ...,
2294 highlightthickness: _ScreenUnits = ...,
2295 image: _ImageSpec = ...,
2296 indicatoron: bool = ...,
2297 justify: Literal["left", "center", "right"] = ...,
2300 padx: _ScreenUnits = ...,
2301 pady: _ScreenUnits = ...,
2302 relief: _Relief = ...,
2303 state: Literal["normal", "active", "disabled"] = ...,
2304 takefocus: _TakeFocusValue = ...,
2305 text: float | str = ...,
2306 textvariable: Variable = ...,
2307 underline: int = ...,
2308 width: _ScreenUnits = ...,
2309 wraplength: _ScreenUnits = ...,
2314 cnf: dict[str, Any] | None = ...,
2316 activebackground: _Color = ...,
2317 activeforeground: _Color = ...,
2318 anchor: _Anchor = ...,
2319 background: _Color = ...,
2320 bd: _ScreenUnits = ...,
2322 bitmap: _Bitmap = ...,
2323 border: _ScreenUnits = ...,
2324 borderwidth: _ScreenUnits = ...,
2325 compound: _Compound = ...,
2326 cursor: _Cursor = ...,
2327 direction: Literal["above", "below", "left", "right", "flush"] = ...,
2328 disabledforeground: _Color = ...,
2330 font: _FontDescription = ...,
2331 foreground: _Color = ...,
2332 height: _ScreenUnits = ...,
2333 highlightbackground: _Color = ...,
2334 highlightcolor: _Color = ...,
2335 highlightthickness: _ScreenUnits = ...,
2336 image: _ImageSpec = ...,
2337 indicatoron: bool = ...,
2338 justify: Literal["left", "center", "right"] = ...,
2340 padx: _ScreenUnits = ...,
2341 pady: _ScreenUnits = ...,
2342 relief: _Relief = ...,
2343 state: Literal["normal", "active", "disabled"] = ...,
2344 takefocus: _TakeFocusValue = ...,
2345 text: float | str = ...,
2346 textvariable: Variable = ...,
2347 underline: int = ...,
2348 width: _ScreenUnits = ...,
2349 wraplength: _ScreenUnits = ...,
2350 ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
2352 def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
2355 class Message(Widget):
2358 master: Misc | None = ...,
2359 cnf: dict[str, Any] | None = ...,
2361 anchor: _Anchor = ...,
2363 background: _Color = ...,
2364 bd: _ScreenUnits = ...,
2366 border: _ScreenUnits = ...,
2367 borderwidth: _ScreenUnits = ...,
2368 cursor: _Cursor = ...,
2370 font: _FontDescription = ...,
2371 foreground: _Color = ...,
2372 highlightbackground: _Color = ...,
2373 highlightcolor: _Color = ...,
2374 highlightthickness: _ScreenUnits = ...,
2375 justify: Literal["left", "center", "right"] = ...,
2377 padx: _ScreenUnits = ...,
2378 pady: _ScreenUnits = ...,
2379 relief: _Relief = ...,
2380 takefocus: _TakeFocusValue = ...,
2381 text: float | str = ...,
2382 textvariable: Variable = ...,
2383 # there's width but no height
2384 width: _ScreenUnits = ...,
2389 cnf: dict[str, Any] | None = ...,
2391 anchor: _Anchor = ...,
2393 background: _Color = ...,
2394 bd: _ScreenUnits = ...,
2396 border: _ScreenUnits = ...,
2397 borderwidth: _ScreenUnits = ...,
2398 cursor: _Cursor = ...,
2400 font: _FontDescription = ...,
2401 foreground: _Color = ...,
2402 highlightbackground: _Color = ...,
2403 highlightcolor: _Color = ...,
2404 highlightthickness: _ScreenUnits = ...,
2405 justify: Literal["left", "center", "right"] = ...,
2406 padx: _ScreenUnits = ...,
2407 pady: _ScreenUnits = ...,
2408 relief: _Relief = ...,
2409 takefocus: _TakeFocusValue = ...,
2410 text: float | str = ...,
2411 textvariable: Variable = ...,
2412 width: _ScreenUnits = ...,
2413 ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
2415 def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
2418 class Radiobutton(Widget):
2421 master: Misc | None = ...,
2422 cnf: dict[str, Any] | None = ...,
2424 activebackground: _Color = ...,
2425 activeforeground: _Color = ...,
2426 anchor: _Anchor = ...,
2427 background: _Color = ...,
2428 bd: _ScreenUnits = ...,
2430 bitmap: _Bitmap = ...,
2431 border: _ScreenUnits = ...,
2432 borderwidth: _ScreenUnits = ...,
2433 command: _ButtonCommand = ...,
2434 compound: _Compound = ...,
2435 cursor: _Cursor = ...,
2436 disabledforeground: _Color = ...,
2438 font: _FontDescription = ...,
2439 foreground: _Color = ...,
2440 height: _ScreenUnits = ...,
2441 highlightbackground: _Color = ...,
2442 highlightcolor: _Color = ...,
2443 highlightthickness: _ScreenUnits = ...,
2444 image: _ImageSpec = ...,
2445 indicatoron: bool = ...,
2446 justify: Literal["left", "center", "right"] = ...,
2448 offrelief: _Relief = ...,
2449 overrelief: _Relief = ...,
2450 padx: _ScreenUnits = ...,
2451 pady: _ScreenUnits = ...,
2452 relief: _Relief = ...,
2453 selectcolor: _Color = ...,
2454 selectimage: _ImageSpec = ...,
2455 state: Literal["normal", "active", "disabled"] = ...,
2456 takefocus: _TakeFocusValue = ...,
2457 text: float | str = ...,
2458 textvariable: Variable = ...,
2459 tristateimage: _ImageSpec = ...,
2460 tristatevalue: Any = ...,
2461 underline: int = ...,
2463 variable: Variable | Literal[""] = ...,
2464 width: _ScreenUnits = ...,
2465 wraplength: _ScreenUnits = ...,
2470 cnf: dict[str, Any] | None = ...,
2472 activebackground: _Color = ...,
2473 activeforeground: _Color = ...,
2474 anchor: _Anchor = ...,
2475 background: _Color = ...,
2476 bd: _ScreenUnits = ...,
2478 bitmap: _Bitmap = ...,
2479 border: _ScreenUnits = ...,
2480 borderwidth: _ScreenUnits = ...,
2481 command: _ButtonCommand = ...,
2482 compound: _Compound = ...,
2483 cursor: _Cursor = ...,
2484 disabledforeground: _Color = ...,
2486 font: _FontDescription = ...,
2487 foreground: _Color = ...,
2488 height: _ScreenUnits = ...,
2489 highlightbackground: _Color = ...,
2490 highlightcolor: _Color = ...,
2491 highlightthickness: _ScreenUnits = ...,
2492 image: _ImageSpec = ...,
2493 indicatoron: bool = ...,
2494 justify: Literal["left", "center", "right"] = ...,
2495 offrelief: _Relief = ...,
2496 overrelief: _Relief = ...,
2497 padx: _ScreenUnits = ...,
2498 pady: _ScreenUnits = ...,
2499 relief: _Relief = ...,
2500 selectcolor: _Color = ...,
2501 selectimage: _ImageSpec = ...,
2502 state: Literal["normal", "active", "disabled"] = ...,
2503 takefocus: _TakeFocusValue = ...,
2504 text: float | str = ...,
2505 textvariable: Variable = ...,
2506 tristateimage: _ImageSpec = ...,
2507 tristatevalue: Any = ...,
2508 underline: int = ...,
2510 variable: Variable | Literal[""] = ...,
2511 width: _ScreenUnits = ...,
2512 wraplength: _ScreenUnits = ...,
2513 ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
2515 def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
2517 def deselect(self): ...
2518 def flash(self): ...
2519 def invoke(self) -> Any: ...
2520 def select(self): ...
2522 class Scale(Widget):
2525 master: Misc | None = ...,
2526 cnf: dict[str, Any] | None = ...,
2528 activebackground: _Color = ...,
2529 background: _Color = ...,
2530 bd: _ScreenUnits = ...,
2532 bigincrement: float = ...,
2533 border: _ScreenUnits = ...,
2534 borderwidth: _ScreenUnits = ...,
2535 # don't know why the callback gets string instead of float
2536 command: str | Callable[[str], Any] = ...,
2537 cursor: _Cursor = ...,
2540 font: _FontDescription = ...,
2541 foreground: _Color = ...,
2543 highlightbackground: _Color = ...,
2544 highlightcolor: _Color = ...,
2545 highlightthickness: _ScreenUnits = ...,
2547 length: _ScreenUnits = ...,
2549 orient: Literal["horizontal", "vertical"] = ...,
2550 relief: _Relief = ...,
2551 repeatdelay: int = ...,
2552 repeatinterval: int = ...,
2553 resolution: float = ...,
2554 showvalue: bool = ...,
2555 sliderlength: _ScreenUnits = ...,
2556 sliderrelief: _Relief = ...,
2557 state: Literal["normal", "active", "disabled"] = ...,
2558 takefocus: _TakeFocusValue = ...,
2559 tickinterval: float = ...,
2561 troughcolor: _Color = ...,
2562 variable: IntVar | DoubleVar = ...,
2563 width: _ScreenUnits = ...,
2568 cnf: dict[str, Any] | None = ...,
2570 activebackground: _Color = ...,
2571 background: _Color = ...,
2572 bd: _ScreenUnits = ...,
2574 bigincrement: float = ...,
2575 border: _ScreenUnits = ...,
2576 borderwidth: _ScreenUnits = ...,
2577 command: str | Callable[[str], Any] = ...,
2578 cursor: _Cursor = ...,
2581 font: _FontDescription = ...,
2582 foreground: _Color = ...,
2584 highlightbackground: _Color = ...,
2585 highlightcolor: _Color = ...,
2586 highlightthickness: _ScreenUnits = ...,
2588 length: _ScreenUnits = ...,
2589 orient: Literal["horizontal", "vertical"] = ...,
2590 relief: _Relief = ...,
2591 repeatdelay: int = ...,
2592 repeatinterval: int = ...,
2593 resolution: float = ...,
2594 showvalue: bool = ...,
2595 sliderlength: _ScreenUnits = ...,
2596 sliderrelief: _Relief = ...,
2597 state: Literal["normal", "active", "disabled"] = ...,
2598 takefocus: _TakeFocusValue = ...,
2599 tickinterval: float = ...,
2601 troughcolor: _Color = ...,
2602 variable: IntVar | DoubleVar = ...,
2603 width: _ScreenUnits = ...,
2604 ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
2606 def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
2609 def set(self, value): ...
2610 def coords(self, value: Any | None = ...): ...
2611 def identify(self, x, y): ...
2613 class Scrollbar(Widget):
2616 master: Misc | None = ...,
2617 cnf: dict[str, Any] | None = ...,
2619 activebackground: _Color = ...,
2620 activerelief: _Relief = ...,
2621 background: _Color = ...,
2622 bd: _ScreenUnits = ...,
2624 border: _ScreenUnits = ...,
2625 borderwidth: _ScreenUnits = ...,
2626 # There are many ways how the command may get called. Search for
2627 # 'SCROLLING COMMANDS' in scrollbar man page. There doesn't seem to
2628 # be any way to specify an overloaded callback function, so we say
2629 # that it can take any args while it can't in reality.
2630 command: Callable[..., tuple[float, float] | None] | str = ...,
2631 cursor: _Cursor = ...,
2632 elementborderwidth: _ScreenUnits = ...,
2633 highlightbackground: _Color = ...,
2634 highlightcolor: _Color = ...,
2635 highlightthickness: _ScreenUnits = ...,
2638 orient: Literal["horizontal", "vertical"] = ...,
2639 relief: _Relief = ...,
2640 repeatdelay: int = ...,
2641 repeatinterval: int = ...,
2642 takefocus: _TakeFocusValue = ...,
2643 troughcolor: _Color = ...,
2644 width: _ScreenUnits = ...,
2649 cnf: dict[str, Any] | None = ...,
2651 activebackground: _Color = ...,
2652 activerelief: _Relief = ...,
2653 background: _Color = ...,
2654 bd: _ScreenUnits = ...,
2656 border: _ScreenUnits = ...,
2657 borderwidth: _ScreenUnits = ...,
2658 command: Callable[..., tuple[float, float] | None] | str = ...,
2659 cursor: _Cursor = ...,
2660 elementborderwidth: _ScreenUnits = ...,
2661 highlightbackground: _Color = ...,
2662 highlightcolor: _Color = ...,
2663 highlightthickness: _ScreenUnits = ...,
2665 orient: Literal["horizontal", "vertical"] = ...,
2666 relief: _Relief = ...,
2667 repeatdelay: int = ...,
2668 repeatinterval: int = ...,
2669 takefocus: _TakeFocusValue = ...,
2670 troughcolor: _Color = ...,
2671 width: _ScreenUnits = ...,
2672 ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
2674 def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
2676 def activate(self, index: Any | None = ...): ...
2677 def delta(self, deltax, deltay): ...
2678 def fraction(self, x, y): ...
2679 def identify(self, x, y): ...
2681 def set(self, first, last): ...
2683 _TextIndex = Union[_tkinter.Tcl_Obj, str, float, Misc]
2685 class Text(Widget, XView, YView):
2688 master: Misc | None = ...,
2689 cnf: dict[str, Any] | None = ...,
2691 autoseparators: bool = ...,
2692 background: _Color = ...,
2693 bd: _ScreenUnits = ...,
2695 blockcursor: bool = ...,
2696 border: _ScreenUnits = ...,
2697 borderwidth: _ScreenUnits = ...,
2698 cursor: _Cursor = ...,
2699 endline: int | Literal[""] = ...,
2700 exportselection: bool = ...,
2702 font: _FontDescription = ...,
2703 foreground: _Color = ...,
2704 # width is always int, but height is allowed to be ScreenUnits.
2705 # This doesn't make any sense to me, and this isn't documented.
2706 # The docs seem to say that both should be integers.
2707 height: _ScreenUnits = ...,
2708 highlightbackground: _Color = ...,
2709 highlightcolor: _Color = ...,
2710 highlightthickness: _ScreenUnits = ...,
2711 inactiveselectbackground: _Color = ...,
2712 insertbackground: _Color = ...,
2713 insertborderwidth: _ScreenUnits = ...,
2714 insertofftime: int = ...,
2715 insertontime: int = ...,
2716 insertunfocussed: Literal["none", "hollow", "solid"] = ...,
2717 insertwidth: _ScreenUnits = ...,
2720 padx: _ScreenUnits = ...,
2721 pady: _ScreenUnits = ...,
2722 relief: _Relief = ...,
2723 selectbackground: _Color = ...,
2724 selectborderwidth: _ScreenUnits = ...,
2725 selectforeground: _Color = ...,
2726 setgrid: bool = ...,
2727 spacing1: _ScreenUnits = ...,
2728 spacing2: _ScreenUnits = ...,
2729 spacing3: _ScreenUnits = ...,
2730 startline: int | Literal[""] = ...,
2731 state: Literal["normal", "disabled"] = ...,
2732 # Literal inside Tuple doesn't actually work
2733 tabs: _ScreenUnits | str | Tuple[_ScreenUnits | str, ...] = ...,
2734 tabstyle: Literal["tabular", "wordprocessor"] = ...,
2735 takefocus: _TakeFocusValue = ...,
2738 wrap: Literal["none", "char", "word"] = ...,
2739 xscrollcommand: _XYScrollCommand = ...,
2740 yscrollcommand: _XYScrollCommand = ...,
2745 cnf: dict[str, Any] | None = ...,
2747 autoseparators: bool = ...,
2748 background: _Color = ...,
2749 bd: _ScreenUnits = ...,
2751 blockcursor: bool = ...,
2752 border: _ScreenUnits = ...,
2753 borderwidth: _ScreenUnits = ...,
2754 cursor: _Cursor = ...,
2755 endline: int | Literal[""] = ...,
2756 exportselection: bool = ...,
2758 font: _FontDescription = ...,
2759 foreground: _Color = ...,
2760 height: _ScreenUnits = ...,
2761 highlightbackground: _Color = ...,
2762 highlightcolor: _Color = ...,
2763 highlightthickness: _ScreenUnits = ...,
2764 inactiveselectbackground: _Color = ...,
2765 insertbackground: _Color = ...,
2766 insertborderwidth: _ScreenUnits = ...,
2767 insertofftime: int = ...,
2768 insertontime: int = ...,
2769 insertunfocussed: Literal["none", "hollow", "solid"] = ...,
2770 insertwidth: _ScreenUnits = ...,
2772 padx: _ScreenUnits = ...,
2773 pady: _ScreenUnits = ...,
2774 relief: _Relief = ...,
2775 selectbackground: _Color = ...,
2776 selectborderwidth: _ScreenUnits = ...,
2777 selectforeground: _Color = ...,
2778 setgrid: bool = ...,
2779 spacing1: _ScreenUnits = ...,
2780 spacing2: _ScreenUnits = ...,
2781 spacing3: _ScreenUnits = ...,
2782 startline: int | Literal[""] = ...,
2783 state: Literal["normal", "disabled"] = ...,
2784 tabs: _ScreenUnits | str | Tuple[_ScreenUnits | str, ...] = ...,
2785 tabstyle: Literal["tabular", "wordprocessor"] = ...,
2786 takefocus: _TakeFocusValue = ...,
2789 wrap: Literal["none", "char", "word"] = ...,
2790 xscrollcommand: _XYScrollCommand = ...,
2791 yscrollcommand: _XYScrollCommand = ...,
2792 ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
2794 def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
2796 def bbox(self, index: _TextIndex) -> tuple[int, int, int, int] | None: ... # type: ignore
2797 def compare(self, index1: _TextIndex, op: Literal["<", "<=", "==", ">=", ">", "!="], index2: _TextIndex) -> bool: ...
2798 def count(self, index1, index2, *args): ... # TODO
2800 def debug(self, boolean: None = ...) -> bool: ...
2802 def debug(self, boolean: bool) -> None: ...
2803 def delete(self, index1: _TextIndex, index2: _TextIndex | None = ...) -> None: ...
2804 def dlineinfo(self, index: _TextIndex) -> tuple[int, int, int, int, int] | None: ...
2809 index2: _TextIndex | None = ...,
2810 command: None = ...,
2818 ) -> list[tuple[str, str, str]]: ...
2823 index2: _TextIndex | None,
2824 command: Callable[[str, str, str], Any] | str,
2837 index2: _TextIndex | None = ...,
2839 command: Callable[[str, str, str], Any] | str,
2847 def edit(self, *args): ... # docstring says "Internal method"
2849 def edit_modified(self, arg: None = ...) -> bool: ... # actually returns Literal[0, 1]
2851 def edit_modified(self, arg: bool) -> None: ... # actually returns empty string
2852 def edit_redo(self) -> None: ... # actually returns empty string
2853 def edit_reset(self) -> None: ... # actually returns empty string
2854 def edit_separator(self) -> None: ... # actually returns empty string
2855 def edit_undo(self) -> None: ... # actually returns empty string
2856 def get(self, index1: _TextIndex, index2: _TextIndex | None = ...) -> str: ...
2857 # TODO: image_* methods
2858 def image_cget(self, index, option): ...
2859 def image_configure(self, index, cnf: Any | None = ..., **kw): ...
2860 def image_create(self, index, cnf=..., **kw): ...
2861 def image_names(self): ...
2862 def index(self, index: _TextIndex) -> str: ...
2863 def insert(self, index: _TextIndex, chars: str, *args: str | list[str] | Tuple[str, ...]) -> None: ...
2865 def mark_gravity(self, markName: str, direction: None = ...) -> Literal["left", "right"]: ...
2867 def mark_gravity(self, markName: str, direction: Literal["left", "right"]) -> None: ... # actually returns empty string
2868 def mark_names(self) -> Tuple[str, ...]: ...
2869 def mark_set(self, markName: str, index: _TextIndex) -> None: ...
2870 def mark_unset(self, *markNames: str) -> None: ...
2871 def mark_next(self, index: _TextIndex) -> str | None: ...
2872 def mark_previous(self, index: _TextIndex) -> str | None: ...
2873 # **kw of peer_create is same as the kwargs of Text.__init__
2874 def peer_create(self, newPathName: str | Text, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
2875 def peer_names(self) -> Tuple[_tkinter.Tcl_Obj, ...]: ...
2876 def replace(self, index1: _TextIndex, index2: _TextIndex, chars: str, *args: str | list[str] | Tuple[str, ...]) -> None: ...
2877 def scan_mark(self, x: int, y: int) -> None: ...
2878 def scan_dragto(self, x: int, y: int) -> None: ...
2883 stopindex: _TextIndex | None = ...,
2884 forwards: bool | None = ...,
2885 backwards: bool | None = ...,
2886 exact: bool | None = ...,
2887 regexp: bool | None = ...,
2888 nocase: bool | None = ...,
2889 count: Variable | None = ...,
2890 elide: bool | None = ...,
2891 ) -> str: ... # returns empty string for not found
2892 def see(self, index: _TextIndex) -> None: ...
2893 def tag_add(self, tagName: str, index1: _TextIndex, *args: _TextIndex) -> None: ...
2894 # tag_bind stuff is very similar to Canvas
2899 sequence: str | None,
2900 func: Callable[[Event[Text]], Any] | None,
2901 add: Literal["", "+"] | bool | None = ...,
2904 def tag_bind(self, tagName: str, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ...
2905 def tag_unbind(self, tagName: str, sequence: str, funcid: str | None = ...) -> None: ...
2906 # allowing any string for cget instead of just Literals because there's no other way to look up tag options
2907 def tag_cget(self, tagName: str, option: str) -> Any: ...
2912 cnf: dict[str, Any] | None = ...,
2914 background: _Color = ...,
2915 bgstipple: _Bitmap = ...,
2916 borderwidth: _ScreenUnits = ...,
2917 border: _ScreenUnits = ..., # alias for borderwidth
2919 fgstipple: _Bitmap = ...,
2920 font: _FontDescription = ...,
2921 foreground: _Color = ...,
2922 justify: Literal["left", "right", "center"] = ...,
2923 lmargin1: _ScreenUnits = ...,
2924 lmargin2: _ScreenUnits = ...,
2925 lmargincolor: _Color = ...,
2926 offset: _ScreenUnits = ...,
2927 overstrike: bool = ...,
2928 overstrikefg: _Color = ...,
2929 relief: _Relief = ...,
2930 rmargin: _ScreenUnits = ...,
2931 rmargincolor: _Color = ...,
2932 selectbackground: _Color = ...,
2933 selectforeground: _Color = ...,
2934 spacing1: _ScreenUnits = ...,
2935 spacing2: _ScreenUnits = ...,
2936 spacing3: _ScreenUnits = ...,
2937 tabs: Any = ..., # the exact type is kind of complicated, see manual page
2938 tabstyle: Literal["tabular", "wordprocessor"] = ...,
2939 underline: bool = ...,
2940 underlinefg: _Color = ...,
2941 wrap: Literal["none", "char", "word"] = ..., # be careful with "none" vs None
2942 ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
2944 def tag_configure(self, tagName: str, cnf: str) -> tuple[str, str, str, Any, Any]: ...
2945 tag_config = tag_configure
2946 def tag_delete(self, __first_tag_name: str, *tagNames: str) -> None: ... # error if no tag names given
2947 def tag_lower(self, tagName: str, belowThis: str | None = ...) -> None: ...
2948 def tag_names(self, index: _TextIndex | None = ...) -> Tuple[str, ...]: ...
2949 def tag_nextrange(self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = ...) -> tuple[str, str] | tuple[()]: ...
2950 def tag_prevrange(self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = ...) -> tuple[str, str] | tuple[()]: ...
2951 def tag_raise(self, tagName: str, aboveThis: str | None = ...) -> None: ...
2952 def tag_ranges(self, tagName: str) -> Tuple[_tkinter.Tcl_Obj, ...]: ...
2953 # tag_remove and tag_delete are different
2954 def tag_remove(self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = ...) -> None: ...
2955 # TODO: window_* methods
2956 def window_cget(self, index, option): ...
2957 def window_configure(self, index, cnf: Any | None = ..., **kw): ...
2958 window_config = window_configure
2959 def window_create(self, index, cnf=..., **kw): ...
2960 def window_names(self): ...
2961 def yview_pickplace(self, *what): ... # deprecated
2964 def __init__(self, var, value, callback: Any | None = ...): ...
2965 def __call__(self, *args): ...
2967 # manual page: tk_optionMenu
2968 class OptionMenu(Menubutton):
2972 # differs from other widgets
2974 master: Misc | None,
2975 variable: StringVar,
2978 # kwarg only from now on
2979 command: Callable[[StringVar], Any] | None = ...,
2981 # configure, config, cget are inherited from Menubutton
2982 # destroy and __getitem__ are overridden, signature does not change
2984 class _Image(Protocol):
2985 tk: _tkinter.TkappType
2986 def height(self) -> int: ...
2987 def width(self) -> int: ...
2991 tk: _tkinter.TkappType
2992 def __init__(self, imgtype, name: Any | None = ..., cnf=..., master: Misc | _tkinter.TkappType | None = ..., **kw): ...
2993 def __del__(self): ...
2994 def __setitem__(self, key, value): ...
2995 def __getitem__(self, key): ...
2998 def height(self) -> int: ...
3000 def width(self) -> int: ...
3002 class PhotoImage(Image):
3005 name: str | None = ...,
3006 cnf: dict[str, Any] = ...,
3007 master: Misc | _tkinter.TkappType | None = ...,
3009 data: str | bytes = ..., # not same as data argument of put()
3011 file: StrOrBytesPath = ...,
3014 palette: int | str = ...,
3020 data: str | bytes = ...,
3022 file: StrOrBytesPath = ...,
3025 palette: int | str = ...,
3029 def blank(self) -> None: ...
3030 def cget(self, option: str) -> str: ...
3031 def __getitem__(self, key: str) -> str: ... # always string: image['height'] can be '0'
3032 def copy(self) -> PhotoImage: ...
3033 def zoom(self, x: int, y: int | Literal[""] = ...) -> PhotoImage: ...
3034 def subsample(self, x: int, y: int | Literal[""] = ...) -> PhotoImage: ...
3035 def get(self, x: int, y: int) -> tuple[int, int, int]: ...
3041 | list[list[_Color]]
3042 | list[Tuple[_Color, ...]]
3044 | Tuple[list[_Color], ...]
3045 | Tuple[Tuple[_Color, ...], ...]
3047 to: tuple[int, int] | None = ...,
3049 def write(self, filename: StrOrBytesPath, format: str | None = ..., from_coords: tuple[int, int] | None = ...) -> None: ...
3050 if sys.version_info >= (3, 8):
3051 def transparency_get(self, x: int, y: int) -> bool: ...
3052 def transparency_set(self, x: int, y: int, boolean: bool) -> None: ...
3054 class BitmapImage(Image):
3057 name: Any | None = ...,
3058 cnf: dict[str, Any] = ...,
3059 master: Misc | _tkinter.TkappType | None = ...,
3061 background: _Color = ...,
3062 data: str | bytes = ...,
3063 file: StrOrBytesPath = ...,
3064 foreground: _Color = ...,
3065 maskdata: str = ...,
3066 maskfile: StrOrBytesPath = ...,
3069 def image_names() -> Tuple[str, ...]: ...
3070 def image_types() -> Tuple[str, ...]: ...
3072 class Spinbox(Widget, XView):
3075 master: Misc | None = ...,
3076 cnf: dict[str, Any] | None = ...,
3078 activebackground: _Color = ...,
3079 background: _Color = ...,
3080 bd: _ScreenUnits = ...,
3082 border: _ScreenUnits = ...,
3083 borderwidth: _ScreenUnits = ...,
3084 buttonbackground: _Color = ...,
3085 buttoncursor: _Cursor = ...,
3086 buttondownrelief: _Relief = ...,
3087 buttonuprelief: _Relief = ...,
3088 # percent substitutions don't seem to be supported, it's similar to Entry's validation stuff
3089 command: Callable[[], Any] | str | list[str] | Tuple[str, ...] = ...,
3090 cursor: _Cursor = ...,
3091 disabledbackground: _Color = ...,
3092 disabledforeground: _Color = ...,
3093 exportselection: bool = ...,
3095 font: _FontDescription = ...,
3096 foreground: _Color = ...,
3099 highlightbackground: _Color = ...,
3100 highlightcolor: _Color = ...,
3101 highlightthickness: _ScreenUnits = ...,
3102 increment: float = ...,
3103 insertbackground: _Color = ...,
3104 insertborderwidth: _ScreenUnits = ...,
3105 insertofftime: int = ...,
3106 insertontime: int = ...,
3107 insertwidth: _ScreenUnits = ...,
3108 invalidcommand: _EntryValidateCommand = ...,
3109 invcmd: _EntryValidateCommand = ...,
3110 justify: Literal["left", "center", "right"] = ...,
3112 readonlybackground: _Color = ...,
3113 relief: _Relief = ...,
3114 repeatdelay: int = ...,
3115 repeatinterval: int = ...,
3116 selectbackground: _Color = ...,
3117 selectborderwidth: _ScreenUnits = ...,
3118 selectforeground: _Color = ...,
3119 state: Literal["normal", "disabled", "readonly"] = ...,
3120 takefocus: _TakeFocusValue = ...,
3121 textvariable: Variable = ...,
3123 validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ...,
3124 validatecommand: _EntryValidateCommand = ...,
3125 vcmd: _EntryValidateCommand = ...,
3126 values: list[str] | Tuple[str, ...] = ...,
3129 xscrollcommand: _XYScrollCommand = ...,
3134 cnf: dict[str, Any] | None = ...,
3136 activebackground: _Color = ...,
3137 background: _Color = ...,
3138 bd: _ScreenUnits = ...,
3140 border: _ScreenUnits = ...,
3141 borderwidth: _ScreenUnits = ...,
3142 buttonbackground: _Color = ...,
3143 buttoncursor: _Cursor = ...,
3144 buttondownrelief: _Relief = ...,
3145 buttonuprelief: _Relief = ...,
3146 command: Callable[[], Any] | str | list[str] | Tuple[str, ...] = ...,
3147 cursor: _Cursor = ...,
3148 disabledbackground: _Color = ...,
3149 disabledforeground: _Color = ...,
3150 exportselection: bool = ...,
3152 font: _FontDescription = ...,
3153 foreground: _Color = ...,
3156 highlightbackground: _Color = ...,
3157 highlightcolor: _Color = ...,
3158 highlightthickness: _ScreenUnits = ...,
3159 increment: float = ...,
3160 insertbackground: _Color = ...,
3161 insertborderwidth: _ScreenUnits = ...,
3162 insertofftime: int = ...,
3163 insertontime: int = ...,
3164 insertwidth: _ScreenUnits = ...,
3165 invalidcommand: _EntryValidateCommand = ...,
3166 invcmd: _EntryValidateCommand = ...,
3167 justify: Literal["left", "center", "right"] = ...,
3168 readonlybackground: _Color = ...,
3169 relief: _Relief = ...,
3170 repeatdelay: int = ...,
3171 repeatinterval: int = ...,
3172 selectbackground: _Color = ...,
3173 selectborderwidth: _ScreenUnits = ...,
3174 selectforeground: _Color = ...,
3175 state: Literal["normal", "disabled", "readonly"] = ...,
3176 takefocus: _TakeFocusValue = ...,
3177 textvariable: Variable = ...,
3179 validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ...,
3180 validatecommand: _EntryValidateCommand = ...,
3181 vcmd: _EntryValidateCommand = ...,
3182 values: list[str] | Tuple[str, ...] = ...,
3185 xscrollcommand: _XYScrollCommand = ...,
3186 ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
3188 def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
3190 def bbox(self, index): ...
3191 def delete(self, first, last: Any | None = ...): ...
3193 def icursor(self, index): ...
3194 def identify(self, x, y): ...
3195 def index(self, index): ...
3196 def insert(self, index, s): ...
3197 # spinbox.invoke("asdf") gives error mentioning .invoke("none"), but it's not documented
3198 def invoke(self, element: Literal["none", "buttonup", "buttondown"]) -> Literal[""]: ...
3199 def scan(self, *args): ...
3200 def scan_mark(self, x): ...
3201 def scan_dragto(self, x): ...
3202 def selection(self, *args: Any) -> Tuple[int, ...]: ...
3203 def selection_adjust(self, index): ...
3204 def selection_clear(self): ...
3205 def selection_element(self, element: Any | None = ...): ...
3206 if sys.version_info >= (3, 8):
3207 def selection_from(self, index: int) -> None: ...
3208 def selection_present(self) -> None: ...
3209 def selection_range(self, start: int, end: int) -> None: ...
3210 def selection_to(self, index: int) -> None: ...
3212 class LabelFrame(Widget):
3215 master: Misc | None = ...,
3216 cnf: dict[str, Any] | None = ...,
3218 background: _Color = ...,
3219 bd: _ScreenUnits = ...,
3221 border: _ScreenUnits = ...,
3222 borderwidth: _ScreenUnits = ...,
3224 colormap: Literal["new", ""] | Misc = ...,
3225 container: bool = ..., # undocumented
3226 cursor: _Cursor = ...,
3228 font: _FontDescription = ...,
3229 foreground: _Color = ...,
3230 height: _ScreenUnits = ...,
3231 highlightbackground: _Color = ...,
3232 highlightcolor: _Color = ...,
3233 highlightthickness: _ScreenUnits = ...,
3234 # 'ne' and 'en' are valid labelanchors, but only 'ne' is a valid _Anchor.
3235 labelanchor: Literal["nw", "n", "ne", "en", "e", "es", "se", "s", "sw", "ws", "w", "wn"] = ...,
3236 labelwidget: Misc = ...,
3238 padx: _ScreenUnits = ...,
3239 pady: _ScreenUnits = ...,
3240 relief: _Relief = ...,
3241 takefocus: _TakeFocusValue = ...,
3242 text: float | str = ...,
3243 visual: str | tuple[str, int] = ...,
3244 width: _ScreenUnits = ...,
3249 cnf: dict[str, Any] | None = ...,
3251 background: _Color = ...,
3252 bd: _ScreenUnits = ...,
3254 border: _ScreenUnits = ...,
3255 borderwidth: _ScreenUnits = ...,
3256 cursor: _Cursor = ...,
3258 font: _FontDescription = ...,
3259 foreground: _Color = ...,
3260 height: _ScreenUnits = ...,
3261 highlightbackground: _Color = ...,
3262 highlightcolor: _Color = ...,
3263 highlightthickness: _ScreenUnits = ...,
3264 labelanchor: Literal["nw", "n", "ne", "en", "e", "es", "se", "s", "sw", "ws", "w", "wn"] = ...,
3265 labelwidget: Misc = ...,
3266 padx: _ScreenUnits = ...,
3267 pady: _ScreenUnits = ...,
3268 relief: _Relief = ...,
3269 takefocus: _TakeFocusValue = ...,
3270 text: float | str = ...,
3271 width: _ScreenUnits = ...,
3272 ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
3274 def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
3277 class PanedWindow(Widget):
3280 master: Misc | None = ...,
3281 cnf: dict[str, Any] | None = ...,
3283 background: _Color = ...,
3284 bd: _ScreenUnits = ...,
3286 border: _ScreenUnits = ...,
3287 borderwidth: _ScreenUnits = ...,
3288 cursor: _Cursor = ...,
3289 handlepad: _ScreenUnits = ...,
3290 handlesize: _ScreenUnits = ...,
3291 height: _ScreenUnits = ...,
3293 opaqueresize: bool = ...,
3294 orient: Literal["horizontal", "vertical"] = ...,
3295 proxybackground: _Color = ...,
3296 proxyborderwidth: _ScreenUnits = ...,
3297 proxyrelief: _Relief = ...,
3298 relief: _Relief = ...,
3299 sashcursor: _Cursor = ...,
3300 sashpad: _ScreenUnits = ...,
3301 sashrelief: _Relief = ...,
3302 sashwidth: _ScreenUnits = ...,
3303 showhandle: bool = ...,
3304 width: _ScreenUnits = ...,
3309 cnf: dict[str, Any] | None = ...,
3311 background: _Color = ...,
3312 bd: _ScreenUnits = ...,
3314 border: _ScreenUnits = ...,
3315 borderwidth: _ScreenUnits = ...,
3316 cursor: _Cursor = ...,
3317 handlepad: _ScreenUnits = ...,
3318 handlesize: _ScreenUnits = ...,
3319 height: _ScreenUnits = ...,
3320 opaqueresize: bool = ...,
3321 orient: Literal["horizontal", "vertical"] = ...,
3322 proxybackground: _Color = ...,
3323 proxyborderwidth: _ScreenUnits = ...,
3324 proxyrelief: _Relief = ...,
3325 relief: _Relief = ...,
3326 sashcursor: _Cursor = ...,
3327 sashpad: _ScreenUnits = ...,
3328 sashrelief: _Relief = ...,
3329 sashwidth: _ScreenUnits = ...,
3330 showhandle: bool = ...,
3331 width: _ScreenUnits = ...,
3332 ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
3334 def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
3336 def add(self, child: Widget, **kw): ...
3337 def remove(self, child): ...
3339 def identify(self, x, y): ...
3340 def proxy(self, *args): ...
3341 def proxy_coord(self): ...
3342 def proxy_forget(self): ...
3343 def proxy_place(self, x, y): ...
3344 def sash(self, *args): ...
3345 def sash_coord(self, index): ...
3346 def sash_mark(self, index): ...
3347 def sash_place(self, index, x, y): ...
3348 def panecget(self, child, option): ...
3349 def paneconfigure(self, tagOrId, cnf: Any | None = ..., **kw): ...
3351 def panes(self): ...