[pygtk] Help with set_cursor() ---- Invisible cursor option

John Finlay finlay at moeraki.com
Tue Aug 4 05:56:03 WST 2009


On 08/03/2009 09:23 PM, John Finlay wrote:
> DINESHBABU DINAKARABABU wrote:
>    
>> Hi everyone,
>>
>> I am pretty new to Python and Pygtk. I would be grateful if someone
>> could help me out with this issue.
>>
>> I am trying to get a full screen display of an image from some raw
>> data using the pixbuf_new_from_data() method. I want to do away with
>> the default cursor option and implement an invisible cursor so that we
>> don't see the cursor during the full screen display. To implement the
>> invisible cursor, I am doing the following:
>>
>> pixmap = gtk.gdk.Pixmap(None, 1, 1, 1)
>> color = gtk.gdk.Color()
>> cursor = gtk.gdk.Cursor(pixmap, pixmap, color, color, 0, 0)
>> gtk.gdk.Window.set_cursor(cursor)
>>
>> However, I am getting this error:
>>
>> TypeError: descriptor 'set_cursor' requires a 'gtk.gdk.Window' object
>> but receives a 'gtk.gdk.Cursor'.
>>
>>      
> Try using:
>
> win.set_cursor(cursor)
>
> The error message is indicating that you have passed the wrong object to
> the function gtk.gdk.Window.set_cursor() which requires a Window object
> and a Cursor object as args. You should invoke the method of the Window
> object win instead.
>
>    
My mistake it should be:

win.window.set_cursor(cursor)

since it's the gtk.gdk.Window object not the gtk.Window object.

john
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20090803/32488a40/attachment.htm 


More information about the pygtk mailing list