Author: ArcRiley
Date: 2008-02-09 00:50:56 -0500 (Sat, 09 Feb 2008)
New Revision: 840
Modified:
trunk/pysoy/src/_core-x11/Window.pxi
trunk/pysoy/src/_core-x11/soy._core.pxd
trunk/pysoy/src/_core-x11/soy._core.pyx
Log:
Hopefully fixed the icon build bug
Modified: trunk/pysoy/src/_core-x11/Window.pxi
===================================================================
--- trunk/pysoy/src/_core-x11/Window.pxi 2008-02-09 05:07:17 UTC (rev
839)
+++ trunk/pysoy/src/_core-x11/Window.pxi 2008-02-09 05:50:56 UTC (rev
840)
@@ -17,9 +17,6 @@
#
# $Id$
-cimport soy.controllers
-cimport stdlib
-
cdef soy._internals.Children _windows
_windows = soy._internals.Children()
@@ -29,18 +26,16 @@
Each instance of this class is a separate window.
'''
- def __cinit__(self, screen, title='', icon=None, background=None,
+ def __cinit__(self, screen, title='', icon=None, background=None,
splash=False, position=(0,0), size=(320,240), *args, **kw) :
if not isinstance(screen, Screen) :
raise TypeError('first argument must be of type soy.Screen')
self._screen = screen
self._controllers = soy._internals.Children()
self._widgets = soy._internals.Children()
- self._title = str(title)
+ self.title = title
if icon :
- self._icon = icon
- else :
- self._icon = None
+ self.icon = icon
if background :
self._background = background
else :
@@ -92,8 +87,6 @@
if self._screen._fullScreen != self and self._splash == 0 :
_atom = glx.XInternAtom(_display, "WM_DELETE_WINDOW", True)
glx.XSetWMProtocols(_display, self._windowID, &_atom, 1)
- if self._icon :
- self.icon = <soy.textures.Texture> self._icon
self._setProperties()
glx.XMapWindow(_display, self._windowID)
glx.XFlush(_display)
@@ -178,7 +171,7 @@
cdef void _setProperties(self) :
glx.XSetStandardProperties(_display, self._windowID,
- self._title, self._title, 0, #was self._icon,
+ self._title, self._title, 0, # self._icon
NULL, 0, NULL)
glx.XFlush(_display)
@@ -236,6 +229,9 @@
def __set__(self, value) :
if type(value) == str :
self._title = value
+ else :
+ self._title = ''
+ if self._opened :
_windows.lock()
self._setProperties()
_windows.unlock()
@@ -250,7 +246,7 @@
'''
def __get__(self) :
if self._icon :
- return self._iconID
+ return <soy.textures.Texture> self._icon
else :
return None
def __set__(self, value) :
@@ -260,11 +256,12 @@
cdef glx.XGCValues gcv
_display = glx.DisplayOfScreen(self._screen._screen)
if not isinstance(value, soy.textures.Texture) :
- raise TypeError('not a Texture')
+ raise TypeError('icon must be an instance of soy.textures.Texture')
if value.depth != 1 :
raise TypeError('texture must not be 3 dimensional')
if value.channels != 3 :
raise TypeError('texture must be RGB format')
+ self._icon = value
ximage_buffer = glx.XCreateImage(_display,
self._screen._xVisualInfo.visual,
value.depth, 2, 0, value.pixels,
value.width, value.height, 32, 32)
Modified: trunk/pysoy/src/_core-x11/soy._core.pxd
===================================================================
--- trunk/pysoy/src/_core-x11/soy._core.pxd 2008-02-09 05:07:17 UTC (rev
839)
+++ trunk/pysoy/src/_core-x11/soy._core.pxd 2008-02-09 05:50:56 UTC (rev
840)
@@ -45,7 +45,7 @@
cdef Screen _screen
cdef glx.Window _windowID
cdef object _title
- cdef void* _icon
+ cdef object _icon
cdef glx.Pixmap _iconID
cdef soy.colors.Color _background
cdef int _width
Modified: trunk/pysoy/src/_core-x11/soy._core.pyx
===================================================================
--- trunk/pysoy/src/_core-x11/soy._core.pyx 2008-02-09 05:07:17 UTC (rev
839)
+++ trunk/pysoy/src/_core-x11/soy._core.pyx 2008-02-09 05:50:56 UTC (rev
840)
@@ -25,10 +25,14 @@
'by '+'$Author$'[9:-2]
__version__ = 'Trunk (r'+'$Rev$'[6:-2]+')'
+cimport stdlib
+
cimport soy.joints
cimport soy.bodies.fields
cimport soy.bodies._bodies
+cimport soy.controllers
cimport soy.scenes
+cimport soy.textures
cimport soy.transports
cimport soy.widgets
import soy.colors
_______________________________________________
PySoy-SVN mailing list
[email protected]
http://www.pysoy.org/mailman/listinfo/pysoy-svn