mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
Add an _Image protocol to tkinter. (#4766)
This commit is contained in:
@@ -95,7 +95,7 @@ _Cursor = Union[str, Tuple[str], Tuple[str, str], Tuple[str, str, str], Tuple[st
|
||||
_EntryValidateCommand = Union[
|
||||
Callable[[], bool], str, _TkinterSequence[str]
|
||||
] # example when it's sequence: entry['invalidcommand'] = [entry.register(print), '%P']
|
||||
_ImageSpec = Union[Image, str] # str can be from e.g. tkinter.image_names()
|
||||
_ImageSpec = Union[_Image, str] # str can be from e.g. tkinter.image_names()
|
||||
_Padding = Union[
|
||||
_ScreenUnits,
|
||||
Tuple[_ScreenUnits],
|
||||
@@ -2831,6 +2831,12 @@ class OptionMenu(Menubutton):
|
||||
# configure, config, cget are inherited from Menubutton
|
||||
# destroy and __getitem__ are overrided, signature does not change
|
||||
|
||||
class _Image(Protocol):
|
||||
tk: _tkinter.TkappType
|
||||
def __del__(self) -> None: ...
|
||||
def height(self) -> int: ...
|
||||
def width(self) -> int: ...
|
||||
|
||||
class Image:
|
||||
name: Any
|
||||
tk: _tkinter.TkappType
|
||||
|
||||
Reference in New Issue
Block a user