That function is expecting a string instead of raw bits.  You could simply
pass the list through the following code:
  data = string.join(map(chr, data), '')

As for cursors, you can only use 2 colour bitmaps -- X does not support
using pixmaps for cursors.  I don't think there is any way to get the xpm
loading functions to output 2 colour bitmaps though, and there is no gdk
wrapper for XReadBitmapFile (the xbm equivalent).

James.

--
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/


On Sun, 11 Jul 1999, J.W. Bizzaro wrote:

> In this method:
> 
>         bitmap = create_bitmap_from_data(window, data, width, height)
> 
> What data structure do I use?
> 
> I tried a list:
> 
> data = [
> 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
> 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
> 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00]
> 
> But I get this error:
> 
> TypeError: gdk_bitmap_create_from_data, argument 2: expected read-only buffer,
> list found
> 
> How do I make a read-only buffer in Python?
> 
> Also, has anyone tried making a custom cursor from a bitmap or pixmap?
> 
> Does anyone have a routine for converting a pixmap into a bitmap?
> 
> Why does...
> 
>     cursor_new_from_pixmap()
> 
> actually expect a bitmap + mask, instead of pixmap + mask?  Why can't I feed
> it...
> 
>     pix, mask = create_pixmap_from_xpm(window, None, "pixmap.xpm")
> 
> ?
> 
> 
> Jeff
> To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]
> 

To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

Reply via email to