Re: global cursor setting?



"Dugas, Alan" <alan dugas analog com> writes:
> Does anyone know how to go about setting a window containing multple widgets
> to have a single cursor?  I am currently trying to modify the gtkfilesel.c
> file to change the cursor to a GDK_WATCH regardless of which widget the
> cursor is over while performing filename completion stuff using;
> 
> gdk_window_set_cursor(GTK_WIDGET(fs)->window,
> gdk_cursor_new(GDK_WATCH));

Note the memory leak there; unlike GtkObject subclasses, there is no
"floating" flag on a GdkCursor. You need to gdk_cursor_destroy() the
cursor after you pass it to set_cursor.

> The code compiles fine, but the cursor does not change at all when I run the
> code?!?!?  Any suggestions would be greatly appreciated.
> 

Hard to say without seeing the code - are you doing this in the
_realize function? Do any other widgets set an explicit cursor
(e.g. GtkEntry sets the I-beam)? If so you have to explicitly change
the cursor for those widgets to NULL (NULL means "use cursor from
parent").

Havoc





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