Re: gdk_gc_predraw error



On Thu, Aug 23, 2001 at 09:21:13AM -0400, Flavio Alberto Lopes Soares wrote : 
> John Cupitt wrote:
> 
> > yy wrote:
> > > One is how to hide cursor? I don't want to show cursor.
> >
> > Hi yy, I guess you could make an empty cursor, and set that
> > as the current. You need:
> >
> >         gdk_cursor_new_from_pixmap() gdk_window_set_cursor()
> 
> I don't want to show cursor too, but I have problems with
> gdk_window_set_cursor
> 
> My code is:
> 
> GdkCursor *cursor; .  .  .  cursor =
> gdk_cursor_new_from_pixmap(NULL, NULL, NULL, NULL, NULL, NULL);
> gdk_window_set_cursor(window_edit, cursor);
> 
> but the compiler say: warning: passing arg 1 of
> gdk_label_set_text from incompatible pointer type
> 
> This is because window_edit was created from gtk_window_new(),
> and I don't know make the window_edit compatible with gdk_
> functions.

A GtkWindow is derived from GtkWidget which provides ->window .
->window is always its associated GdkWindow (or its parent
GdkWindow in some cases). Your widget needs to be realize'd so
you can access its GdkWindow:

window_edit = gtk_window_new();
gtk_widget_realize(GTK_WIDGET(window_edit));
[...]

gdk_window_set_cursor(window_edit->window, ...

- Markus




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