@@ -2197,32 +2197,30 @@ class Listbox(Widget, XView, YView):
2197
2197
@overload
2198
2198
def configure (self , cnf : str ) -> tuple [str , str , str , Any , Any ]: ...
2199
2199
config = configure
2200
- def activate (self , index : int | str ) -> None : ...
2201
- def bbox (self , index : int | str ) -> tuple [int , int , int , int ] | None : ... # type: ignore[override]
2200
+ def activate (self , index : str | int ) -> None : ...
2201
+ def bbox (self , index : str | int ) -> tuple [int , int , int , int ] | None : ... # type: ignore[override]
2202
2202
def curselection (self ): ...
2203
- def delete (self , first : int | str , last : int | str | None = ...) -> None : ...
2204
- def get (self , first : int | str , last : int | str | None = ...): ...
2205
- def index (self , index : int | str ) -> int : ...
2206
- def insert (self , index : int | str , * elements : str | float ) -> None : ...
2203
+ def delete (self , first : str | int , last : str | int | None = ...) -> None : ...
2204
+ def get (self , first : str | int , last : str | int | None = ...): ...
2205
+ def index (self , index : str | int ) -> int : ...
2206
+ def insert (self , index : str | int , * elements : str | float ) -> None : ...
2207
2207
def nearest (self , y ): ...
2208
2208
def scan_mark (self , x , y ) -> None : ...
2209
2209
def scan_dragto (self , x , y ) -> None : ...
2210
- def see (self , index : int | str ) -> None : ...
2211
- def selection_anchor (self , index : int | str ) -> None : ...
2210
+ def see (self , index : str | int ) -> None : ...
2211
+ def selection_anchor (self , index : str | int ) -> None : ...
2212
2212
select_anchor = selection_anchor
2213
- def selection_clear (self , first : int | str , last : int | str | None = ...) -> None : ... # type: ignore[override]
2213
+ def selection_clear (self , first : str | int , last : str | int | None = ...) -> None : ... # type: ignore[override]
2214
2214
select_clear = selection_clear
2215
- def selection_includes (self , index : int | str ): ...
2215
+ def selection_includes (self , index : str | int ): ...
2216
2216
select_includes = selection_includes
2217
- def selection_set (self , first : int | str , last : int | str | None = ...) -> None : ...
2217
+ def selection_set (self , first : str | int , last : str | int | None = ...) -> None : ...
2218
2218
select_set = selection_set
2219
2219
def size (self ) -> int : ... # type: ignore[override]
2220
- def itemcget (self , index : int | str , option ): ...
2221
- def itemconfigure (self , index : int | str , cnf : Any | None = ..., ** kw ): ...
2220
+ def itemcget (self , index : str | int , option ): ...
2221
+ def itemconfigure (self , index : str | int , cnf : Any | None = ..., ** kw ): ...
2222
2222
itemconfig = itemconfigure
2223
2223
2224
- _MenuIndex : TypeAlias = str | int
2225
-
2226
2224
class Menu (Widget ):
2227
2225
def __init__ (
2228
2226
self ,
@@ -2285,8 +2283,8 @@ class Menu(Widget):
2285
2283
@overload
2286
2284
def configure (self , cnf : str ) -> tuple [str , str , str , Any , Any ]: ...
2287
2285
config = configure
2288
- def tk_popup (self , x : int , y : int , entry : _MenuIndex = ...) -> None : ...
2289
- def activate (self , index : _MenuIndex ) -> None : ...
2286
+ def tk_popup (self , x : int , y : int , entry : str | int = ...) -> None : ...
2287
+ def activate (self , index : str | int ) -> None : ...
2290
2288
def add (self , itemType , cnf = ..., ** kw ): ... # docstring says "Internal function."
2291
2289
def insert (self , index , itemType , cnf = ..., ** kw ): ... # docstring says "Internal function."
2292
2290
def add_cascade (
@@ -2384,7 +2382,7 @@ class Menu(Widget):
2384
2382
def add_separator (self , cnf : dict [str , Any ] | None = ..., * , background : _Color = ...) -> None : ...
2385
2383
def insert_cascade (
2386
2384
self ,
2387
- index : _MenuIndex ,
2385
+ index : str | int ,
2388
2386
cnf : dict [str , Any ] | None = ...,
2389
2387
* ,
2390
2388
accelerator : str = ...,
@@ -2406,7 +2404,7 @@ class Menu(Widget):
2406
2404
) -> None : ...
2407
2405
def insert_checkbutton (
2408
2406
self ,
2409
- index : _MenuIndex ,
2407
+ index : str | int ,
2410
2408
cnf : dict [str , Any ] | None = ...,
2411
2409
* ,
2412
2410
accelerator : str = ...,
@@ -2433,7 +2431,7 @@ class Menu(Widget):
2433
2431
) -> None : ...
2434
2432
def insert_command (
2435
2433
self ,
2436
- index : _MenuIndex ,
2434
+ index : str | int ,
2437
2435
cnf : dict [str , Any ] | None = ...,
2438
2436
* ,
2439
2437
accelerator : str = ...,
@@ -2454,7 +2452,7 @@ class Menu(Widget):
2454
2452
) -> None : ...
2455
2453
def insert_radiobutton (
2456
2454
self ,
2457
- index : _MenuIndex ,
2455
+ index : str | int ,
2458
2456
cnf : dict [str , Any ] | None = ...,
2459
2457
* ,
2460
2458
accelerator : str = ...,
@@ -2478,20 +2476,20 @@ class Menu(Widget):
2478
2476
value : Any = ...,
2479
2477
variable : Variable = ...,
2480
2478
) -> None : ...
2481
- def insert_separator (self , index : _MenuIndex , cnf : dict [str , Any ] | None = ..., * , background : _Color = ...) -> None : ...
2482
- def delete (self , index1 : _MenuIndex , index2 : _MenuIndex | None = ...) -> None : ...
2483
- def entrycget (self , index : _MenuIndex , option : str ) -> Any : ...
2479
+ def insert_separator (self , index : str | int , cnf : dict [str , Any ] | None = ..., * , background : _Color = ...) -> None : ...
2480
+ def delete (self , index1 : str | int , index2 : str | int | None = ...) -> None : ...
2481
+ def entrycget (self , index : str | int , option : str ) -> Any : ...
2484
2482
def entryconfigure (
2485
- self , index : _MenuIndex , cnf : dict [str , Any ] | None = ..., ** kw : Any
2483
+ self , index : str | int , cnf : dict [str , Any ] | None = ..., ** kw : Any
2486
2484
) -> dict [str , tuple [str , str , str , Any , Any ]] | None : ...
2487
2485
entryconfig = entryconfigure
2488
- def index (self , index : _MenuIndex ) -> int | None : ...
2489
- def invoke (self , index : _MenuIndex ) -> Any : ...
2486
+ def index (self , index : str | int ) -> int | None : ...
2487
+ def invoke (self , index : str | int ) -> Any : ...
2490
2488
def post (self , x : int , y : int ) -> None : ...
2491
- def type (self , index : _MenuIndex ) -> Literal ["cascade" , "checkbutton" , "command" , "radiobutton" , "separator" ]: ...
2489
+ def type (self , index : str | int ) -> Literal ["cascade" , "checkbutton" , "command" , "radiobutton" , "separator" ]: ...
2492
2490
def unpost (self ) -> None : ...
2493
- def xposition (self , index : _MenuIndex ) -> int : ...
2494
- def yposition (self , index : _MenuIndex ) -> int : ...
2491
+ def xposition (self , index : str | int ) -> int : ...
2492
+ def yposition (self , index : str | int ) -> int : ...
2495
2493
2496
2494
class Menubutton (Widget ):
2497
2495
def __init__ (
0 commit comments