> Hi,
>
> I am trying to change the size of the cursor in my app and I cannot get
> the following code to work for me.
>
>
> self.window.get_settings().set_long_property('gtk-cursor-theme-size',
> 48, '')
> print "default cursor size: ",
> gtk.gdk.Display.get_default_cursor_size()
>
> - I have tested with gconf and the following code does work:
>
> cmd = 'gconftool-2 -s -t int
> /desktop/gnome/peripherals/mouse/cursor_size 48'
> os.system(cmd)
>
> My program is a wizard app that runs post gdm login and pre gnome
> session. Running gconftool-2 causes the gnome session to start in the
> background which defeats the purpose of the wizard.
>
> - I have also tried setting it in the gtkrc file for the app like so:
>
> gtk-cursor-theme-size=48
>
> and calling rc_parse in the code like this:
>
> gtk.rc_parse("gtkrc")
>
> But that doesn't work either.
>
>
> I would appreciate any suggestions as there is very little online about
> this issue that I can find.
Answering my own question in case it saves someone else some time down the
line. It's really too easy! Not sure why this is not the first hit on
google already. With this code you can load any png image as a custom
cursor.
filename = sys.path[0] + "/image.png"
cur=gtk.gdk.Cursor(gtk.gdk.display_get_default(),gtk.gdk.pixbuf_new_from_file(filename),5,5)
self.window.window.set_cursor(cur)
--
Patrick Shirkey
Boost Hardware Ltd
_______________________________________________
pygtk mailing list [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/