diff --git a/stdlib/3/tkinter/__init__.pyi b/stdlib/3/tkinter/__init__.pyi index e90a988b2490..c8b3037d8f5f 100644 --- a/stdlib/3/tkinter/__init__.pyi +++ b/stdlib/3/tkinter/__init__.pyi @@ -1,4 +1,5 @@ import sys +from enum import Enum from types import TracebackType from typing import Any, Optional, Dict, Callable, Tuple, Type, Union from tkinter.constants import * # noqa: F403 @@ -11,7 +12,69 @@ READABLE: Any WRITABLE: Any EXCEPTION: Any -class Event: ... +if sys.version_info >= (3, 6): + class EventType(str, Enum): + Activate: str = ... + ButtonPress: str = ... + ButtonRelease: str = ... + Circulate: str = ... + CirculateRequest: str = ... + ClientMessage: str = ... + Colormap: str = ... + Configure: str = ... + ConfigureRequest: str = ... + Create: str = ... + Deactivate: str = ... + Destroy: str = ... + Enter: str = ... + Expose: str = ... + FocusIn: str = ... + FocusOut: str = ... + GraphicsExpose: str = ... + Gravity: str = ... + KeyPress: str = ... + KeyRelease: str = ... + Keymap: str = ... + Leave: str = ... + Map: str = ... + MapRequest: str = ... + Mapping: str = ... + Motion: str = ... + MouseWheel: str = ... + NoExpose: str = ... + Property: str = ... + Reparent: str = ... + ResizeRequest: str = ... + Selection: str = ... + SelectionClear: str = ... + SelectionRequest: str = ... + Unmap: str = ... + VirtualEvent: str = ... + Visibility: str = ... + +class Event: + serial: int + num: int + focus: bool + height: int + width: int + keycode: int + state: Union[int, str] + time: int + x: int + y: int + x_root: int + y_root: int + char: str + send_event: bool + keysym: str + keysym_num: int + if sys.version_info >= (3, 6): + type: EventType + else: + type: str + widget: Misc + delta: int def NoDefaultRoot(): ...