From f94628ad42f67acb5ad7d5005b366fb2849c310a Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 13 Dec 2004 13:50:34 +0000 Subject: [PATCH] Add some docs for GtkWidget::delete-event and GtkWidget::destroy-event. 2004-12-13 Matthias Clasen * gtk/gtkwidget.c (gtk_widget_class_init): Add some docs for GtkWidget::delete-event and GtkWidget::destroy-event. (#161142, Paolo Borelli) --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gtk/gtkwidget.c | 29 +++++++++++++++++++++++++++++ 5 files changed, 53 insertions(+) diff --git a/ChangeLog b/ChangeLog index cab3090fea..2eb9a70ef2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-12-13 Matthias Clasen + + * gtk/gtkwidget.c (gtk_widget_class_init): Add some docs for + GtkWidget::delete-event and GtkWidget::destroy-event. (#161142, + Paolo Borelli) + 2004-12-13 Matthias Clasen * gtk/gtklabel.[hc]: Add a max-width-chars property, which can diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index cab3090fea..2eb9a70ef2 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +2004-12-13 Matthias Clasen + + * gtk/gtkwidget.c (gtk_widget_class_init): Add some docs for + GtkWidget::delete-event and GtkWidget::destroy-event. (#161142, + Paolo Borelli) + 2004-12-13 Matthias Clasen * gtk/gtklabel.[hc]: Add a max-width-chars property, which can diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index cab3090fea..2eb9a70ef2 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +2004-12-13 Matthias Clasen + + * gtk/gtkwidget.c (gtk_widget_class_init): Add some docs for + GtkWidget::delete-event and GtkWidget::destroy-event. (#161142, + Paolo Borelli) + 2004-12-13 Matthias Clasen * gtk/gtklabel.[hc]: Add a max-width-chars property, which can diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index cab3090fea..2eb9a70ef2 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +2004-12-13 Matthias Clasen + + * gtk/gtkwidget.c (gtk_widget_class_init): Add some docs for + GtkWidget::delete-event and GtkWidget::destroy-event. (#161142, + Paolo Borelli) + 2004-12-13 Matthias Clasen * gtk/gtklabel.[hc]: Add a max-width-chars property, which can diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 6de6e489e5..809c5ba2b6 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -755,6 +755,21 @@ gtk_widget_class_init (GtkWidgetClass *klass) _gtk_marshal_BOOLEAN__BOXED, G_TYPE_BOOLEAN, 1, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + +/** + * GtkWidget::delete-event: + * @widget: the object which received the signal. + * @event: the event which triggered this signal + * + * The ::delete-event signal is emitted if a user requests that + * a toplevel window is closed. The default handler for this signal + * destroys the window. Connecting gtk_widget_hide_on_delete() to + * this signal will cause the window to be hidden instead, so that + * it can later be shown again without reconstructing it. + * + * Returns: %TRUE to stop other handlers from being invoked for the event. + * %FALSE to propagate the event further. + */ widget_signals[DELETE_EVENT] = g_signal_new ("delete_event", G_TYPE_FROM_CLASS (gobject_class), @@ -764,6 +779,20 @@ gtk_widget_class_init (GtkWidgetClass *klass) _gtk_marshal_BOOLEAN__BOXED, G_TYPE_BOOLEAN, 1, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + +/** + * GtkWidget::destroy-event: + * @widget: the object which received the signal. + * @event: the event which triggered this signal + * + * The ::destroy-event signal is emitted when a #GdkWindow is destroyed. + * You rarely get this signal, because most widgets disconnect themselves + * from their window before they destroy it, so no widget owns the + * window at destroy time. + * + * Returns: %TRUE to stop other handlers from being invoked for the event. + * %FALSE to propagate the event further. + */ widget_signals[DESTROY_EVENT] = g_signal_new ("destroy_event", G_TYPE_FROM_CLASS (gobject_class),