setting busy interactive pointer (left_ptr_watch)



Hi,

I'm trying to add the "Busy-Interactive" pointer to my pygtk app as described in the HIG:
http://developer.gnome.org/projects/gup/hig/2.0/feedback-types.html

Now mozilla at least has a nice themed animated version of this pointer,
which I understand, X/GDK do not support directly according to:
http://vektor-sigma.livejournal.com/1137.html
http://www.mail-archive.com/devel 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.

thanks,
P�aig.
----------------------

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

print "hash to match:     08e8e1c95fe2fc01f976f1e063a24ccd"

import gtk
w=gtk.Window()
w.realize()

#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
#LEFT_PTR_WATCH=gtk.gdk.Cursor(gtk.gdk.WATCH)

#set cursor
w.window.set_cursor(LEFT_PTR_WATCH)

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



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