summaryrefslogtreecommitdiff
path: root/gtk/gtknativedialog.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2015-11-11 16:06:44 +0100
committerAlexander Larsson <alexl@redhat.com>2015-11-11 16:06:44 +0100
commit51dc4873fd8b4d4f14f902870b6110dd70a224e3 (patch)
treee56983907037a8e27007d27d551af9e8fd04eb0f /gtk/gtknativedialog.c
parent402225a8e23bcff118055568ca79f4b73a3951f8 (diff)
downloadgtk+-51dc4873fd8b4d4f14f902870b6110dd70a224e3.tar.gz
Add gtk_native_dialog_destroy()
Its very easy to get extra references to the NativeDialog so that when you release your last reference any visible dialog is not hidden. We handle this by adding a destroy method similar to how you destroy regular toplevels.
Diffstat (limited to 'gtk/gtknativedialog.c')
-rw-r--r--gtk/gtknativedialog.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gtk/gtknativedialog.c b/gtk/gtknativedialog.c
index d67047c591..e4fbb675bc 100644
--- a/gtk/gtknativedialog.c
+++ b/gtk/gtknativedialog.c
@@ -361,6 +361,30 @@ gtk_native_dialog_hide (GtkNativeDialog *self)
g_object_notify_by_pspec (G_OBJECT (self), native_props[PROP_VISIBLE]);
}
+/**
+ * gtk_native_dialog_destroy:
+ * @self: a #GtkNativeDialog
+ *
+ * Destroys a dialog.
+ *
+ * When a dialog is destroyed, it will break any references it holds
+ * to other objects. If it is visible it will be hidden and any underlying
+ * window system resources will be destroyed.
+ *
+ * Note that this does not release any reference to the object (as opposed to
+ * destroying a GtkWindow) because there is no reference from the windowing
+ * system to the #GtkNativeDialog.
+ *
+ * Since: 3.20
+ **/
+void
+gtk_native_dialog_destroy (GtkNativeDialog *self)
+{
+ g_return_if_fail (GTK_IS_NATIVE_DIALOG (self));
+
+ g_object_run_dispose (G_OBJECT (self));
+}
+
void
_gtk_native_dialog_emit_response (GtkNativeDialog *self,
int response_id)