Re: gdk_gc_predraw error
- From: Sven Neumann <sven gimp org>
- To: Markus Fischer <mfischer guru josefine at>
- Cc: Flavio Alberto Lopes Soares <engenharia3 maqplas com br>, John Cupitt <john cupitt ng-london org uk>, yy <yynuaa 163 com>, gtk-list gnome org
- Subject: Re: gdk_gc_predraw error
- Date: 23 Aug 2001 16:49:30 +0200
Hi,
Markus Fischer <mfischer guru josefine at> writes:
> 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, ...
explicitely realizing the window is ugly, try:
window_edit = gtk_window_new();
gtk_signal_connect_after (GTK_OBJECT (window_edit), "realize",
GTK_SIGNAL_FUNC (window_edit_realize),
cursor);
static void
window_edit_realize (GtkWidget *widget,
gpointer data)
{
GdkCursor *cursor = (GdkCursor *) data;
if (GTK_WIDGET_REALIZED (widget))
{
/* now widget->window is valid and the cursor can be set */
...
}
}
Salut, Sven
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]