setting busy interactive pointer (left_ptr_watch)


I'm trying to add the "Busy-Interactive" pointer to my pygtk app as described in the HIG:

Now mozilla at least has a nice themed animated version of this pointer,
which I understand, X/GDK do not support directly according to: xfree86 org/msg00428.html
I used the bitmap referenced above, but it generates a different
hash as can be seen in the program below.
Note this program works on pygtk2-2.6.0-3 but not on 2.8.1-0ubuntu2
do to an apparent interface change in gtk.gdk.bitmap_create_from_data ?

So my questions in summary:

1. Is there an easier way to set left_ptr_watch instead of copying the mozilla bits?
2. If not how does one set the correct bits?
3. Is there a way to do this across the referenced pygtk versions at least.


import os
os.environ['XCURSOR_DISCOVER']='1' #Turn on logging in Xlib

print "hash to match:     08e8e1c95fe2fc01f976f1e063a24ccd"

import gtk

#used `convert spinning.gif spinning.xbm`
bit_data =     "\x01\x00\x03\x00\x07\x00\x0f\x00\x1f\x00\x3f\x00\x7f\x00\xff\x0e\x1f\x0e\x1b\x15\x31\x37\x30\x11\x60\x0e\x60\x0e"
#used bitmap util to save inverse of above
bitmask_data = "\xfe\xff\xfc\xff\xf8\xff\xf0\xff\xe0\xff\xc0\xff\x80\xff\x00\xf1\xe0\xf1\xe4\xea\xce\xc8\xcf\xee\x9f\xf1\x9f\xf1"

#create pixmap from xbm data
pix = gtk.gdk.bitmap_create_from_data(None, bit_data, 14, 14)
mask = gtk.gdk.bitmap_create_from_data(None, bitmask_data, 14, 14)

#set cursor from pixmap
color = gtk.gdk.Color()
LEFT_PTR_WATCH=gtk.gdk.Cursor(mask, pix, color, color, 0, 0)
#Note needed to switch mask and pix params above?

#set cursor from enum

#set cursor

w.connect("destroy", gtk.main_quit)

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]