[gimp/gimp-2-10] app: add gimp_gtk_container_clear()
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] app: add gimp_gtk_container_clear()
- Date: Mon, 20 Aug 2018 18:44:42 +0000 (UTC)
commit fba9de69ee5ede4e491ecab8343dc1533f7dcda0
Author: Ell <ell_se yahoo com>
Date: Mon Aug 20 14:14:26 2018 -0400
app: add gimp_gtk_container_clear()
... which removes all non-internal children of a GtkContainer.
(cherry picked from commit fd64aae47bc6a61ec49c571771b1dad587ba446a)
app/widgets/gimpwidgets-utils.c | 15 +++++++++++++++
app/widgets/gimpwidgets-utils.h | 2 ++
2 files changed, 17 insertions(+)
---
diff --git a/app/widgets/gimpwidgets-utils.c b/app/widgets/gimpwidgets-utils.c
index a7e065a257..b7b6d296b6 100644
--- a/app/widgets/gimpwidgets-utils.c
+++ b/app/widgets/gimpwidgets-utils.c
@@ -1611,6 +1611,21 @@ gimp_widget_set_fully_opaque (GtkWidget *widget,
GINT_TO_POINTER (fully_opaque));
}
+static void
+gimp_gtk_container_clear_callback (GtkWidget *widget,
+ GtkContainer *container)
+{
+ gtk_container_remove (container, widget);
+}
+
+void
+gimp_gtk_container_clear (GtkContainer *container)
+{
+ gtk_container_foreach (container,
+ (GtkCallback) gimp_gtk_container_clear_callback,
+ container);
+}
+
static gboolean
gimp_print_event_free (gpointer data)
{
diff --git a/app/widgets/gimpwidgets-utils.h b/app/widgets/gimpwidgets-utils.h
index 523bab1d0f..157d0d5ce4 100644
--- a/app/widgets/gimpwidgets-utils.h
+++ b/app/widgets/gimpwidgets-utils.h
@@ -112,6 +112,8 @@ gboolean gimp_widget_get_fully_opaque (GtkWidget *widget
void gimp_widget_set_fully_opaque (GtkWidget *widget,
gboolean fully_opaque);
+void gimp_gtk_container_clear (GtkContainer *container);
+
const gchar * gimp_print_event (const GdkEvent *event);
gboolean gimp_color_profile_store_add_defaults
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]