diff --git a/csdl/events.py b/csdl/events.py index 8be263c..026961b 100644 --- a/csdl/events.py +++ b/csdl/events.py @@ -1,7 +1,8 @@ import ctypes from .internal import _SDL, Version +from .enum import CEnum -class EventType(int): +class EventType(CEnum): FIRSTEVENT = 0 QUIT = 0x100 @@ -54,7 +55,7 @@ GestureID = ctypes.c_int64 TouchID = ctypes.c_int64 FingerID = ctypes.c_int64 -class SysWMType(int): +class SysWMType(CEnum): UNKNOWN = 0 WINDOWS = 1 X11 = 2 diff --git a/demo/random_rectangles.py b/demo/random_rectangles.py index d935c63..b92409f 100644 --- a/demo/random_rectangles.py +++ b/demo/random_rectangles.py @@ -14,7 +14,7 @@ def main(): if not event: break else: - print event.type + print repr(EventType.from_int(event.type)) window.renderer.set_draw_color(0,0,0,255) window.renderer.clear()