CEnum-ize event enums

This commit is contained in:
James Turk 2011-03-27 14:10:06 -04:00
parent 5317df0635
commit 4388b17f78
2 changed files with 4 additions and 3 deletions

View File

@ -1,7 +1,8 @@
import ctypes import ctypes
from .internal import _SDL, Version from .internal import _SDL, Version
from .enum import CEnum
class EventType(int): class EventType(CEnum):
FIRSTEVENT = 0 FIRSTEVENT = 0
QUIT = 0x100 QUIT = 0x100
@ -54,7 +55,7 @@ GestureID = ctypes.c_int64
TouchID = ctypes.c_int64 TouchID = ctypes.c_int64
FingerID = ctypes.c_int64 FingerID = ctypes.c_int64
class SysWMType(int): class SysWMType(CEnum):
UNKNOWN = 0 UNKNOWN = 0
WINDOWS = 1 WINDOWS = 1
X11 = 2 X11 = 2

View File

@ -14,7 +14,7 @@ def main():
if not event: if not event:
break break
else: else:
print event.type print repr(EventType.from_int(event.type))
window.renderer.set_draw_color(0,0,0,255) window.renderer.set_draw_color(0,0,0,255)
window.renderer.clear() window.renderer.clear()