[pygtk] bitmap_create_from_data in C and python

Suresh Jeevanandam jm.suresh at gmail.com
Sun Mar 18 21:58:03 WST 2007


Hi,

Whats the python equivalent of the following C code?

#define gray50_width 4
#define gray50_height 4
static char gray50_bits[] =3D {
  0x01, 0x02, 0x04, 0x08 };
stipple =3D gdk_bitmap_create_from_data (NULL, gray50_bits, gray50_width,
gray50_height);


I created this stipple pattern this way in python:
stipple =3D gtk.gdk.bitmap_create_from_data(None, '0x01, 0x02, 0x04, 0x08',=
 4,
4)

But when I use this stipple pattern the result is totally different from
that of what I see in the C implementation.

stipple =3D gtk.gdk.bitmap_create_from_data(None, '0x12, 0x48', 4, 4) comes
closer to the C implementation.

Am I missing something ???
-
Suresh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20070318/fc597464/at=
tachment.htm


More information about the pygtk mailing list