mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-20 19:01:15 +08:00
tkinter: add type hints to Wm methods (#4925)
This commit is contained in:
@@ -485,32 +485,45 @@ class YView:
|
||||
def yview_scroll(self, number, what): ...
|
||||
|
||||
class Wm:
|
||||
@overload
|
||||
def wm_aspect(self, minNumer: int, minDenom: int, maxNumer: int, maxDenom: int) -> None: ...
|
||||
@overload
|
||||
def wm_aspect(
|
||||
self,
|
||||
minNumer: Optional[Any] = ...,
|
||||
minDenom: Optional[Any] = ...,
|
||||
maxNumer: Optional[Any] = ...,
|
||||
maxDenom: Optional[Any] = ...,
|
||||
): ...
|
||||
aspect: Any
|
||||
def wm_attributes(self, *args): ...
|
||||
attributes: Any
|
||||
def wm_client(self, name: Optional[Any] = ...): ...
|
||||
client: Any
|
||||
def wm_colormapwindows(self, *wlist): ...
|
||||
colormapwindows: Any
|
||||
def wm_command(self, value: Optional[Any] = ...): ...
|
||||
command: Any
|
||||
def wm_deiconify(self): ...
|
||||
deiconify: Any
|
||||
self, minNumer: None = ..., minDenom: None = ..., maxNumer: None = ..., maxDenom: None = ...
|
||||
) -> Optional[Tuple[int, int, int, int]]: ...
|
||||
aspect = wm_aspect
|
||||
@overload
|
||||
def wm_attributes(self) -> Tuple[Any, ...]: ...
|
||||
@overload
|
||||
def wm_attributes(self, __option: str) -> Any: ...
|
||||
@overload
|
||||
def wm_attributes(self, __option: str, __value: Any, *__other_option_value_pairs: Any) -> None: ...
|
||||
attributes = wm_attributes
|
||||
def wm_client(self, name: Optional[str] = ...) -> str: ...
|
||||
client = wm_client
|
||||
@overload
|
||||
def wm_colormapwindows(self) -> List[Misc]: ...
|
||||
@overload
|
||||
def wm_colormapwindows(self, __wlist: _TkinterSequence[Misc]) -> None: ...
|
||||
@overload
|
||||
def wm_colormapwindows(self, __first_wlist_item: Misc, *other_wlist_items: Misc) -> None: ...
|
||||
colormapwindows = wm_colormapwindows
|
||||
def wm_command(self, value: Optional[str] = ...) -> str: ...
|
||||
command = wm_command
|
||||
# Some of these always return empty string, but return type is set to None to prevent accidentally using it
|
||||
def wm_deiconify(self) -> None: ...
|
||||
deiconify = wm_deiconify
|
||||
def wm_focusmodel(self, model: Optional[Any] = ...): ...
|
||||
focusmodel: Any
|
||||
def wm_forget(self, window): ...
|
||||
forget: Any
|
||||
focusmodel = wm_focusmodel
|
||||
def wm_forget(self, window: Wm) -> None: ...
|
||||
forget = wm_forget
|
||||
def wm_frame(self): ...
|
||||
frame: Any
|
||||
def wm_geometry(self, newGeometry: Optional[Any] = ...): ...
|
||||
geometry: Any
|
||||
frame = wm_frame
|
||||
@overload
|
||||
def wm_geometry(self, newGeometry: None = ...) -> str: ...
|
||||
@overload
|
||||
def wm_geometry(self, newGeometry: str) -> None: ...
|
||||
geometry = wm_geometry
|
||||
def wm_grid(
|
||||
self,
|
||||
baseWidth: Optional[Any] = ...,
|
||||
@@ -518,47 +531,73 @@ class Wm:
|
||||
widthInc: Optional[Any] = ...,
|
||||
heightInc: Optional[Any] = ...,
|
||||
): ...
|
||||
grid: Any
|
||||
grid = wm_grid
|
||||
def wm_group(self, pathName: Optional[Any] = ...): ...
|
||||
group: Any
|
||||
group = wm_group
|
||||
def wm_iconbitmap(self, bitmap: Optional[Any] = ..., default: Optional[Any] = ...): ...
|
||||
iconbitmap: Any
|
||||
def wm_iconify(self): ...
|
||||
iconify: Any
|
||||
iconbitmap = wm_iconbitmap
|
||||
def wm_iconify(self) -> None: ...
|
||||
iconify = wm_iconify
|
||||
def wm_iconmask(self, bitmap: Optional[Any] = ...): ...
|
||||
iconmask: Any
|
||||
iconmask = wm_iconmask
|
||||
def wm_iconname(self, newName: Optional[Any] = ...): ...
|
||||
iconname: Any
|
||||
def wm_iconphoto(self, default: bool = ..., *args): ...
|
||||
iconphoto: Any
|
||||
iconname = wm_iconname
|
||||
def wm_iconphoto(self, default: bool, __image1: Image, *args: Image) -> None: ...
|
||||
iconphoto = wm_iconphoto
|
||||
def wm_iconposition(self, x: Optional[Any] = ..., y: Optional[Any] = ...): ...
|
||||
iconposition: Any
|
||||
iconposition = wm_iconposition
|
||||
def wm_iconwindow(self, pathName: Optional[Any] = ...): ...
|
||||
iconwindow: Any
|
||||
iconwindow = wm_iconwindow
|
||||
def wm_manage(self, widget): ...
|
||||
manage: Any
|
||||
def wm_maxsize(self, width: Optional[Any] = ..., height: Optional[Any] = ...): ...
|
||||
maxsize: Any
|
||||
def wm_minsize(self, width: Optional[Any] = ..., height: Optional[Any] = ...): ...
|
||||
minsize: Any
|
||||
def wm_overrideredirect(self, boolean: Optional[Any] = ...): ...
|
||||
overrideredirect: Any
|
||||
manage = wm_manage
|
||||
@overload
|
||||
def wm_maxsize(self, width: None = ..., height: None = ...) -> Tuple[int, int]: ...
|
||||
@overload
|
||||
def wm_maxsize(self, width: int, height: int) -> None: ...
|
||||
maxsize = wm_maxsize
|
||||
@overload
|
||||
def wm_minsize(self, width: None = ..., height: None = ...) -> Tuple[int, int]: ...
|
||||
@overload
|
||||
def wm_minsize(self, width: int, height: int) -> None: ...
|
||||
minsize = wm_minsize
|
||||
@overload
|
||||
def wm_overrideredirect(self, boolean: None = ...) -> Optional[bool]: ... # returns True or None
|
||||
@overload
|
||||
def wm_overrideredirect(self, boolean: bool) -> None: ...
|
||||
overrideredirect = wm_overrideredirect
|
||||
def wm_positionfrom(self, who: Optional[Any] = ...): ...
|
||||
positionfrom: Any
|
||||
def wm_protocol(self, name: Optional[Any] = ..., func: Optional[Any] = ...): ...
|
||||
protocol: Any
|
||||
def wm_resizable(self, width: Optional[Any] = ..., height: Optional[Any] = ...): ...
|
||||
resizable: Any
|
||||
positionfrom = wm_positionfrom
|
||||
@overload
|
||||
def wm_protocol(self, name: str, func: Union[Callable[[], Any], str]) -> None: ...
|
||||
@overload
|
||||
def wm_protocol(self, name: str, func: None = ...) -> str: ...
|
||||
@overload
|
||||
def wm_protocol(self, name: None = ..., func: None = ...) -> Tuple[str, ...]: ...
|
||||
protocol = wm_protocol
|
||||
@overload
|
||||
def wm_resizable(self, width: None = ..., height: None = ...) -> Tuple[bool, bool]: ...
|
||||
@overload
|
||||
def wm_resizable(self, width: bool, height: bool) -> None: ...
|
||||
resizable = wm_resizable
|
||||
def wm_sizefrom(self, who: Optional[Any] = ...): ...
|
||||
sizefrom: Any
|
||||
def wm_state(self, newstate: Optional[Any] = ...): ...
|
||||
state: Any
|
||||
def wm_title(self, string: Optional[Any] = ...): ...
|
||||
title: Any
|
||||
def wm_transient(self, master: Optional[Any] = ...): ...
|
||||
transient: Any
|
||||
def wm_withdraw(self): ...
|
||||
withdraw: Any
|
||||
sizefrom = wm_sizefrom
|
||||
@overload
|
||||
def wm_state(self, newstate: None = ...) -> str: ...
|
||||
@overload
|
||||
def wm_state(self, newstate: str) -> None: ...
|
||||
state = wm_state
|
||||
@overload
|
||||
def wm_title(self, string: None = ...) -> str: ...
|
||||
@overload
|
||||
def wm_title(self, string: str) -> None: ...
|
||||
title = wm_title
|
||||
@overload
|
||||
def wm_transient(self, master: None = ...) -> _tkinter.Tcl_Obj: ...
|
||||
@overload
|
||||
def wm_transient(self, master: Union[Wm, _tkinter.Tcl_Obj]) -> None: ...
|
||||
transient = wm_transient
|
||||
def wm_withdraw(self) -> None: ...
|
||||
withdraw = wm_withdraw
|
||||
|
||||
class _ExceptionReportingCallback(Protocol):
|
||||
def __call__(self, __exc: Type[BaseException], __val: BaseException, __tb: TracebackType) -> Any: ...
|
||||
|
||||
Reference in New Issue
Block a user