Re: Why "GtkWidget->window" is "NULL" when "gtk_window_new()"

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

 



On Mon, 2008-08-11 at 17:45 +0800, Wu Yin wrote:
> Code:
> +----------------------------------------------------------
> | GtkWidget *w;
> |
> | w = gtk_window_new(GTK_WINDOW_TOPLEVEL);
> +----------------------------------------------------------
> Why the "w->window" is "NULL"?

the GdkWindow is created after a widget is realized (except for
NO_WINDOW widgets).

> The GdkDrawable is NULL ,how can I draw things on it?

use the "realize" signal: connect a callback to that signal and you're
guaranteed that widget->window will be available.

also, read the documentation:

  http://library.gnome.org/devel/gtk/stable/GtkWidget.html#gtk-widget-realize

ciao,
 Emmanuele.

-- 
Emmanuele Bassi,
W: http://www.emmanuelebassi.net
B: http://log.emmanuelebassi.net

_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux