From 4388b17f78d7228308615b2132a7e05666843775 Mon Sep 17 00:00:00 2001 From: James Turk Date: Sun, 27 Mar 2011 14:10:06 -0400 Subject: [PATCH] CEnum-ize event enums --- csdl/events.py | 5 +++-- demo/random_rectangles.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) 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()