Re: Maintaining a GtkWindow



"Chris Garrett" <garrett91 hotmail com> writes:

Hi,

I am trying to create a window that can be opened from a menu entry.
The window is created successfully when the menu entry is first
clicked on.  However, when the close button (on the window manager) is
clicked (generating a destroy event), the window destroys itself.  I
have tried to hide the widget instead, but the next call to
show_airbrush_dialog() generates an error:

Gtk-CRITICAL **: file ../../gtk/gtkwidget.c: line 1770
(gtk_widget_show_all): assertion `GTK_IS_WIDGET (widget)' failed


Is there a way of creating a window that can be hidden and shown at
will, and is not destroyed when the close button in the window
titlebar is clicked?

You need to connect a handler that returns TRUE to delete_event; (TRUE
== I handled it) gtk_widget_hide_on_delete() is a "precanned" handler
that may be useful for this purpose.

Mentioned in:

 http://developer.gnome.org/doc/GGAD/cha-gtk.html

I can't think of where it woudl be in the GTK+ docs, if anywhere.

Regards,
                                        Owen



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