Author: JonNeal
Date: 2008-02-08 16:08:14 -0500 (Fri, 08 Feb 2008)
New Revision: 837
Modified:
trunk/pysoy/src/_core-x11/Window.pxi
trunk/pysoy/src/_core-x11/glx.pxd
Log:
Getting icon help
Modified: trunk/pysoy/src/_core-x11/Window.pxi
===================================================================
--- trunk/pysoy/src/_core-x11/Window.pxi 2008-02-07 16:39:50 UTC (rev
836)
+++ trunk/pysoy/src/_core-x11/Window.pxi 2008-02-08 21:08:14 UTC (rev
837)
@@ -37,7 +37,10 @@
self._controllers = soy._internals.Children()
self._widgets = soy._internals.Children()
self._title = str(title)
- #self.icon = icon
+ if icon :
+ self._icon = icon
+ else :
+ self._icon = None
if background :
self._background = background
else :
@@ -89,8 +92,8 @@
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 = self._icon
+ if self._icon :
+ self.icon = <soy.textures.Texture> self._icon
self._setProperties()
glx.XMapWindow(_display, self._windowID)
glx.XFlush(_display)
@@ -238,14 +241,13 @@
_windows.unlock()
- #property icon:
- '''Window's icon texture
+ property icon:
+ '''Window's icon texture
This property is the window's "icon", however the window manager uses it.
Textures must be 1D or 2D (not 3D) and /should/ be square.
-
Defaults to None.
-
+ '''
def __get__(self) :
if self._icon :
return self._iconID
@@ -271,9 +273,10 @@
gcv.function = glx.GXcopy
gc_cache = glx.XCreateGC(_display, self._iconID, glx.GCFunction, &gcv)
glx.XPutImage(_display, self._iconID, gc_cache, ximage_buffer, 0, 0, 0,
0, value.width, value.height)
- #_windows.lock()
- #self._setProperties()
- #_windows.unlock() '''
+ glx.XFillRectangle(_display, self._iconID, gc_cache, 0, 0, value.width,
value.height)
+ _windows.lock()
+ self._setProperties()
+ _windows.unlock()
property background:
Modified: trunk/pysoy/src/_core-x11/glx.pxd
===================================================================
--- trunk/pysoy/src/_core-x11/glx.pxd 2008-02-07 16:39:50 UTC (rev 836)
+++ trunk/pysoy/src/_core-x11/glx.pxd 2008-02-08 21:08:14 UTC (rev 837)
@@ -621,10 +621,6 @@
unsigned long green_mask
unsigned long blue_mask
XPointer obdata
-
- #ctypedef struct XExtData :
- # int number
- # XPointer private_data
ctypedef struct XGCValues :
int function
@@ -649,16 +645,12 @@
Pixmap clip_mask
int dash_offset
char dashes
-
- #ctypedef struct GC :
- # GContext gid
- # XExtData *ext_data
- cdef XImage *XCreateImage( Display*, Visual*, unsigned int,
+ cdef XImage *XCreateImage( Display*, Visual*, unsigned int,
int, int, char*, unsigned int,
unsigned int, int, int )
- cdef int XPutImage( Display*, Drawable, GC, XImage*,
+ cdef int XPutImage( Display*, Drawable, GC, XImage*,
int, int, int, int, unsigned int,
unsigned int )
- cdef GC XCreateGC( Display*, Drawable, unsigned long, XGCValues* )
-
+ cdef GC XCreateGC( Display*, Drawable, unsigned long, XGCValues* )
+ cdef int XFillRectangle( Display*, Drawable, GC, int, int, unsigned
int, unsigned int )
_______________________________________________
PySoy-SVN mailing list
[email protected]
http://www.pysoy.org/mailman/listinfo/pysoy-svn