GtkWindow represents a
toplevel dialog or application window. As the primary
toplevel widget in GTK+, it has many special
responsibilities; for example, it maintains the current
keyboard focus and determines its own size allocation
(rather than receiving one from a parent widget).
Gnome applications typically use
GnomeApp for main application windows, to take
advantage of its added features; for dialogs, you
should use GnomeDialog with
Gnome and GtkDialog with
GTK+. Of course there are several specialized dialog
subclasses available as well. If none of GtkWindow's subclasses seem
appropriate to your application,
GtkWindow can also be used directly.
A danger worthy of note:
GtkWindow is automatically destroyed if it
receives a "delete_event"
signal. To prevent this, you must install the last signal handler to run, and your
signal handler must return
TRUE. This is a very common GTK+ programming
mistake; see the section
called Window Change Events in the chapter
called GDK Basics for details. GnomeDialog will help you handle this
situation; see the chapter
called User Communication: Dialogs.
It is a good idea to make
GtkWindow the last container you call gtk_widget_show() on. Most widgets are
not actually mapped (placed onscreen) until their
parent container is; but
GtkWindow has no parent, and appears immediately.
So if you show its children after you've shown the
window, you will see some flicker.