[pygtk] Fwd: Question

Michal Pryc Michal.Pryc at Sun.COM
Thu Feb 12 02:27:23 WST 2009


Hello,
This FAQ should help you:
http://faq.pygtk.org/index.py?req=show&file=faq05.006.htp

Part:
  pix_data = """/* XPM */
  static char * invisible_xpm[] = {
  "1 1 1 1",
  "       c None",
  " "};"""
  color = gtk.gdk.Color()
  pix = gtk.gdk.pixmap_create_from_data(None, pix_data, 1, 1, 1, color, 
color)
  invisible = gtk.gdk.Cursor(pix, pix, color, color, 0, 0)
  b.window.set_cursor(invisible)

so instead of creating pix from pix_data, simply you need to create it 
from the given image. This should do the job for you.

--
best
Michal Pryc
http://blogs.sun.com/migi


Johan Dahlin wrote:
> ---------- Forwarded message ----------
> From: Rodrigo Almeida<rodrigoalmei at gmail.com>
> Date: Tue, Feb 10, 2009 at 6:37 PM
> Subject: Question
> To: pygtk-web at async.com.br
>
>
> Hello Friends,
>
> I'm a programmer from Brasil, and i am doing an application using pygtk.
> I would like to know if you can help me. My question is: is there a
> way to use an image as a cursor?
>
> something like this:
>
> self.image.set_from_file("myimage.png")
> self.Tela.window.set_cursor(self.image)
>
> I hope you can help me.
>
> Greetings.
>
> Rodrigo Almeida.
> _______________________________________________
> pygtk mailing list   pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/



More information about the pygtk mailing list