sdlterm/cython/sdlterm.pyx
changeset 49 1611c462c3e3
parent 48 1f00e90fd72a
child 50 c5b8b9d2da95
--- a/sdlterm/cython/sdlterm.pyx	Sat Jan 05 12:40:32 2013 +0100
+++ b/sdlterm/cython/sdlterm.pyx	Sat Jan 05 16:47:30 2013 +0100
@@ -3,7 +3,7 @@
 # distutils: include_dirs = /usr/include/SDL src
 # distutils: libraries = SDL SDL_ttf
 # distutils: define_macros = _GNU_SOURCE=1 _REENTRANT
-# distutils: extra_compile_args = --std=c++0x
+# distutils: extra_compile_args = --std=c++11
 # cython: language_level=3
 
 from libcpp cimport bool
@@ -35,8 +35,8 @@
     cdef cppclass Terminal:
         Terminal() except +
 
-        void select_font(char *fname_regular, char *fname_bold, int ptsize)
-        void resize(int pxwidth, int pxheight)
+        void select_font(char *fname_regular, char *fname_bold, int ptsize) except +
+        void resize(int pxwidth, int pxheight) except +
 
         void erase()
         void putch(int x, int y, Py_UNICODE ch)
@@ -56,6 +56,7 @@
 
 cdef class SDLTerminal:
     cdef Terminal *thisptr      # hold a C++ instance which we're wrapping
+    cdef Event event
 
     def __cinit__(self):
         self.thisptr = new Terminal()
@@ -77,8 +78,8 @@
         self.thisptr.commit()
 
     def get_next_event(self):
-        cdef Event event
-        self.thisptr.get_next_event(event)
+        self.thisptr.get_next_event(self.event)
+        event = self.event
         if event.type == event.MOUSEMOVE:
             return ('mousemove', event.mouse.x, event.mouse.y)
         if event.type == event.MOUSEDOWN: