Author: ArcRiley
Date: 2007-07-05 20:37:34 -0400 (Thu, 05 Jul 2007)
New Revision: 374

Modified:
   trunk/pysoy/src/_core-x11/Window.pxi
   trunk/pysoy/src/_core-x11/soy._core.pxd
Log:
fixing ticket #249 (soy.Window.title bug)


Modified: trunk/pysoy/src/_core-x11/Window.pxi
===================================================================
--- trunk/pysoy/src/_core-x11/Window.pxi        2007-07-05 23:59:10 UTC (rev 
373)
+++ trunk/pysoy/src/_core-x11/Window.pxi        2007-07-06 00:37:34 UTC (rev 
374)
@@ -63,8 +63,7 @@
       self._screen._xVisualInfo, NULL, gl.GL_TRUE)
     _atom = glx.XInternAtom(_display, "WM_DELETE_WINDOW", True)
     glx.XSetWMProtocols(_display, self._windowID, &_atom, 1)
-    glx.XSetStandardProperties(_display, self._windowID, title, title, 
-                               0, NULL, 0, NULL)
+    self._setProperties()
     glx.XMapWindow(_display, self._windowID)
     _sleep(10) # Let X11 finish before returning to Python
     _windows.lock()
@@ -88,7 +87,6 @@
     cdef int i
     cdef glx.Display *_display
     _display = glx.DisplayOfScreen(self._screen._screen)
-
     glx.glXMakeCurrent(_display, self._windowID, self._glxContext)
     if self._screen._glVersion == 0 :
       self._screen._glewInit()
@@ -123,7 +121,6 @@
 
   cdef void _resize(self) :
     cdef int i
-
     self._width  = gl.glutGet(gl.GLUT_WINDOW_WIDTH)
     self._height = gl.glutGet(gl.GLUT_WINDOW_HEIGHT)
     # Resize widgets
@@ -131,8 +128,17 @@
     for i from 0 <= i < self._widgets.current :
       (<soy.widgets.Widget> self._widgets.list[i])._resize()
     self._widgets.unlock()
-    
 
+
+  cdef void _setProperties(self) :
+    cdef glx.Display *_display
+    _display = glx.DisplayOfScreen(self._screen._screen)
+    glx.XSetStandardProperties(_display, self._windowID, 
+                               self._title, self._title, 
+                               0, NULL, 0, NULL)
+    glx.XFlush(_display)
+
+
   property title:
     '''Window's title string
    
@@ -146,11 +152,10 @@
       return self._title
     def __set__(self, value) :
       if type(value) == str :
+        self._title = value
         _windows.lock()
-        gl.glutSetWindow(self._windowID)
-        gl.glutSetWindowTitle(value)
+        self._setProperties()
         _windows.unlock()
-        self._title = value
 
   property background:
     '''Window's background color

Modified: trunk/pysoy/src/_core-x11/soy._core.pxd
===================================================================
--- trunk/pysoy/src/_core-x11/soy._core.pxd     2007-07-05 23:59:10 UTC (rev 
373)
+++ trunk/pysoy/src/_core-x11/soy._core.pxd     2007-07-06 00:37:34 UTC (rev 
374)
@@ -59,6 +59,7 @@
   # _coreloop methods
   cdef void                      _render(self)
   cdef void                      _resize(self)
+  cdef void                      _setProperties(self)
 
 cdef extern from "sys/time.h" :
   cdef struct timeval :

_______________________________________________
PySoy-SVN mailing list
[email protected]
http://www.pysoy.org/mailman/listinfo/pysoy-svn

Reply via email to