[pygtk] pygtk compiled with numpy for win32

Osmo Maatta osmoma at gmail.com
Sun Feb 21 17:45:43 WST 2010


Hello,

Maybe you can use the gtk.gdk.pixbuf_new_from_data() function instead.

Take a look at this module (som functions I prototyped for my 
Gscreendump program).
http://www.futuredesktop.com/tmp/switch_desktop.py
Look for  "get_window_icon_image" function.

Use struct.pack_into(...) to pack the data appropriately into a byte array.

Ref: http://docs.python.org/dev/3.0/library/struct.html
struct.pack_into("=BBBB", bytearr,  offset, b1, b2, b3, b4)

then call
pixbuf  = gtk.gdk.pixbuf_new_from_data(bytearr,  gtk.gdk.COLORSPACE_RGB, 
True, 8, icon_width, icon_height, icon_width * 4)

// Moma Antero
   Oslo

Craig Warren wrote:
> Hi folks,
>
> I'm trying to use gtk.gdk.pixbuf_new_from_array to make a pixbuf from a numpy array and getting a runtime error "pygtk was not compiled with Numeric Python support". I used the following to install pygtk and numpy:
>
> pygtk-2.16.0+glade.win32-py2.6
> numpy-1.3.0-win32-superpack-python2.6
>
> Is pygtk-2.16.0 compiled with numpy? Why does the error refer to Numeric Python, I thought this was deprecated?
>
> I'd like not to have to install MinGW etc and have to compile pygtk myself. Any suggestions?
>
> Thanks.
>
> Craig
>   


Craig Warren wrote:
> Hi folks,
>
> I'm trying to use gtk.gdk.pixbuf_new_from_array to make a pixbuf from a numpy array and getting a runtime error "pygtk was not compiled with Numeric Python support". I used the following to install pygtk and numpy:
>
> pygtk-2.16.0+glade.win32-py2.6
> numpy-1.3.0-win32-superpack-python2.6
>
> Is pygtk-2.16.0 compiled with numpy? Why does the error refer to Numeric Python, I thought this was deprecated?
>
> I'd like not to have to install MinGW etc and have to compile pygtk myself. Any suggestions?
>
> Thanks.
>
> Craig
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20100221/d0be50c1/attachment.htm 


More information about the pygtk mailing list