Hello friends, I want to hide a window when user clicks either on the close button or press the close (CROSS) on the top-right of every window. Here is my code:
GtkWidget *window1; GtkWidget *butt_close; g_signal_connect((gpointer)butt_close,"clicked", G_CALLBACK (on_butt_close_clicked), (gpointer) window1); g_signal_connect ((gpointer) window1, "destroy", G_CALLBACK (on_butt_close_clicked), (gpointer) window1); void on_butt_close_clicked(GtkButton *button,gpointer user_data) { gtk_widget_hide((GtkWidget *)user_data); } The window hides up when I click the close button but when I try and hide it through clicking the close button on the top right of the window it gives the following error: (stepper_ui:15295): GLib-GObject-CRITICAL **: g_object_ref: assertion `G_IS_OBJECT (object)' failed (stepper_ui:15295): Gtk-CRITICAL **: gtk_widget_queue_resize: assertion `GTK_IS_WIDGET (widget)' failed (stepper_ui:15295): GLib-GObject-WARNING **: instance of invalid non-instantiatable type `(null)' (stepper_ui:15295): GLib-GObject-CRITICAL **: g_signal_emit_valist: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed (stepper_ui:15295): GLib-GObject-CRITICAL **: g_object_notify: assertion `G_IS_OBJECT (object)' failed (stepper_ui:15295): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed (stepper_ui:15295): GLib-GObject-CRITICAL **: g_object_ref: assertion `G_IS_OBJECT (object)' failed (stepper_ui:15295): Gtk-CRITICAL **: gtk_widget_queue_resize: assertion `GTK_IS_WIDGET (widget)' failed (stepper_ui:15295): GLib-GObject-WARNING **: instance of invalid non-instantiatable type `(null)' (stepper_ui:15295): GLib-GObject-CRITICAL **: g_signal_emit_valist: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed (stepper_ui:15295): GLib-GObject-CRITICAL **: g_object_notify: assertion `G_IS_OBJECT (object)' failed (stepper_ui:15295): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed (stepper_ui:15295): GLib-GObject-WARNING **: invalid uninstantiatable type `(null)' in cast to `GtkTextView' (stepper_ui:15295): Gtk-CRITICAL **: gtk_text_view_get_buffer: assertion `GTK_IS_TEXT_VIEW (text_view)' failed (stepper_ui:15295): Gtk-CRITICAL **: gtk_text_buffer_get_start_iter: assertion `GTK_IS_TEXT_BUFFER (buffer)' failed (stepper_ui:15295): Gtk-CRITICAL **: gtk_text_buffer_get_end_iter: assertion `GTK_IS_TEXT_BUFFER (buffer)' failed (stepper_ui:15295): Gtk-CRITICAL **: gtk_text_buffer_insert: assertion `GTK_IS_TEXT_BUFFER (buffer)' failed (stepper_ui:15295): GLib-GObject-WARNING **: invalid uninstantiatable type `(null)' in cast to `GtkTextView' (stepper_ui:15295): Gtk-CRITICAL **: gtk_text_view_set_buffer: assertion `GTK_IS_TEXT_VIEW (text_view)' failed s I suppose that I am hiding a window from it's own destroy event. Regards __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list