[gimp] app: add dialogs_destroy_dialog(), destroys an attached dialog by its key



commit 12428ea7d7320a0ca00fa603259b6b90364150e1
Author: Michael Natterer <mitch gimp org>
Date:   Sun Sep 25 01:23:55 2016 +0200

    app: add dialogs_destroy_dialog(), destroys an attached dialog by its key

 app/dialogs/dialogs.c |   15 +++++++++++++++
 app/dialogs/dialogs.h |    2 ++
 2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/app/dialogs/dialogs.c b/app/dialogs/dialogs.c
index 71fae44..08eab1d 100644
--- a/app/dialogs/dialogs.c
+++ b/app/dialogs/dialogs.c
@@ -729,3 +729,18 @@ dialogs_detach_dialog (GObject   *attach_object,
                                         dialogs_detach_dialog,
                                         attach_object);
 }
+
+void
+dialogs_destroy_dialog (GObject     *attach_object,
+                        const gchar *attach_key)
+{
+  GtkWidget *dialog;
+
+  g_return_if_fail (G_IS_OBJECT (attach_object));
+  g_return_if_fail (attach_key != NULL);
+
+  dialog = g_object_get_data (attach_object, attach_key);
+
+  if (dialog)
+    gtk_widget_destroy (dialog);
+}
diff --git a/app/dialogs/dialogs.h b/app/dialogs/dialogs.h
index b55b208..51f0644 100644
--- a/app/dialogs/dialogs.h
+++ b/app/dialogs/dialogs.h
@@ -43,6 +43,8 @@ void        dialogs_attach_dialog     (GObject         *attach_object,
                                        GtkWidget       *dialog);
 void        dialogs_detach_dialog     (GObject         *attach_object,
                                        GtkWidget       *dialog);
+void        dialogs_destroy_dialog    (GObject         *attach_object,
+                                       const gchar     *attach_key);
 
 
 #endif /* __DIALOGS_H__ */


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