Skip to content

Commit 51267a4

Browse files
authored
Add tkinter Event class (#4200)
1 parent 3d84c52 commit 51267a4

File tree

1 file changed

+64
-1
lines changed

1 file changed

+64
-1
lines changed

stdlib/3/tkinter/__init__.pyi

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import sys
2+
from enum import Enum
23
from types import TracebackType
34
from typing import Any, Optional, Dict, Callable, Tuple, Type, Union
45
from tkinter.constants import * # noqa: F403
@@ -11,7 +12,69 @@ READABLE: Any
1112
WRITABLE: Any
1213
EXCEPTION: Any
1314

14-
class Event: ...
15+
if sys.version_info >= (3, 6):
16+
class EventType(str, Enum):
17+
Activate: str = ...
18+
ButtonPress: str = ...
19+
ButtonRelease: str = ...
20+
Circulate: str = ...
21+
CirculateRequest: str = ...
22+
ClientMessage: str = ...
23+
Colormap: str = ...
24+
Configure: str = ...
25+
ConfigureRequest: str = ...
26+
Create: str = ...
27+
Deactivate: str = ...
28+
Destroy: str = ...
29+
Enter: str = ...
30+
Expose: str = ...
31+
FocusIn: str = ...
32+
FocusOut: str = ...
33+
GraphicsExpose: str = ...
34+
Gravity: str = ...
35+
KeyPress: str = ...
36+
KeyRelease: str = ...
37+
Keymap: str = ...
38+
Leave: str = ...
39+
Map: str = ...
40+
MapRequest: str = ...
41+
Mapping: str = ...
42+
Motion: str = ...
43+
MouseWheel: str = ...
44+
NoExpose: str = ...
45+
Property: str = ...
46+
Reparent: str = ...
47+
ResizeRequest: str = ...
48+
Selection: str = ...
49+
SelectionClear: str = ...
50+
SelectionRequest: str = ...
51+
Unmap: str = ...
52+
VirtualEvent: str = ...
53+
Visibility: str = ...
54+
55+
class Event:
56+
serial: int
57+
num: int
58+
focus: bool
59+
height: int
60+
width: int
61+
keycode: int
62+
state: Union[int, str]
63+
time: int
64+
x: int
65+
y: int
66+
x_root: int
67+
y_root: int
68+
char: str
69+
send_event: bool
70+
keysym: str
71+
keysym_num: int
72+
if sys.version_info >= (3, 6):
73+
type: EventType
74+
else:
75+
type: str
76+
widget: Misc
77+
delta: int
1578

1679
def NoDefaultRoot(): ...
1780

0 commit comments

Comments
 (0)