Re: [pygtk] setting busy interactive pointer (left_ptr_watch)
- From: Pádraig Brady <P draigBrady com>
- To: gtk-list gnome org, pygtk daa com au
- Subject: Re: [pygtk] setting busy interactive pointer (left_ptr_watch)
- Date: Sat, 12 May 2007 01:20:14 +0100
P�aig Brady wrote:
> 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.
That's because the bitmap referenced above is incorrect.
mozilla actually uses a 32x32 bitmap.
A working example is 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 ?
It's actually due to a reappearance for a while of an old bug I think?
http://bugzilla.gnome.org/show_bug.cgi?id=103616
I still have a couple of questions:
1. Is there an easier way to set left_ptr_watch instead of copying the mozilla bits?
2. Is there a way to create a Pixmap of depth 1 using pixmap_create_from_xpm_d
thanks,
P�aig.
-----------
import os
os.environ['XCURSOR_DISCOVER']='1' #Turn on logging in Xlib
#left_ptr_watch hash is 08e8e1c95fe2fc01f976f1e063a24ccd
import gtk
w=gtk.Window()
w.realize()
bit_data = "\
\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\
\x0c\x00\x00\x00\x1c\x00\x00\x00\x3c\x00\x00\x00\
\x7c\x00\x00\x00\xfc\x00\x00\x00\xfc\x01\x00\x00\
\xfc\x3b\x00\x00\x7c\x38\x00\x00\x6c\x54\x00\x00\
\xc4\xdc\x00\x00\xc0\x44\x00\x00\x80\x39\x00\x00\
\x80\x39\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00"
try:
pix = gtk.gdk.bitmap_create_from_data(None, bit_data, 32, 32)
color = gtk.gdk.Color()
LEFT_PTR_WATCH=gtk.gdk.Cursor(pix, pix, color, color, 2, 2)
except TypeError:
#old bug http://bugzilla.gnome.org/show_bug.cgi?id=103616
#seems to pop up again?
#pygtk2-2.6.0-3 OK
#2.8.1-0ubuntu2 Not OK
#2.10.4-0ubuntu OK
LEFT_PTR_WATCH=None #default 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]