Revision: fb8dd9e39d0e
Author: Nicolas Rougier <
Nicolas...@inria.fr>
Date: Mon Dec 31 00:27:58 2012
Log: Try to fix issue #22 on undefined glutScrollFunc and glutCheckLoop
http://code.google.com/p/glumpy/source/detail?r=fb8dd9e39d0e
Modified:
/glumpy/window/backend_glut.py
=======================================
--- /glumpy/window/backend_glut.py Fri Aug 17 00:59:33 2012
+++ /glumpy/window/backend_glut.py Mon Dec 31 00:27:58 2012
@@ -43,12 +43,13 @@
# For OSX, see
https://github.com/nanoant/osxglut
# GLUT for Mac OS X fork with Core Profile and scroll wheel support
-glutScrollFunc = None
+OSX_glutScrollFunc = None
try:
- glutScrollFunc = GLUTCallback(
+ OSX_glutScrollFunc = GLUTCallback(
'Scroll', (c_float,c_float), ('delta_x','delta_y'),)
except:
- pass
+ OSX_glutScrollFunc = None
+
def show():
@@ -144,9 +145,9 @@
glut.glutEntryFunc( self._entry )
glut.glutSpecialFunc( self._special )
glut.glutSpecialUpFunc( self._special_up )
- if glutScrollFunc:
- glutScrollFunc( self._scroll)
- elif glut.glutMouseWheelFunc:
+ if OSX_glutScrollFunc is not None:
+ OSX_glutScrollFunc( self._scroll)
+ elif bool(glut.glutMouseWheelFunc):
glutMouseWheelFunc( self._wheel)
if size is not None:
width, height = size
@@ -553,7 +554,10 @@
if not self._interactive:
#glut.glutMainLoop()
while not self._stop_mainloop:
- glut.glutCheckLoop()
+ try:
+ glut.glutCheckLoop()
+ except:
+ glut.glutMainLoopEvent()
def stop(self):