[gtk/kill-containers] actionbar: Add gtk_action_bar_remove



commit 58184ce3c0233455a43ec4288d3381c58e61c6b3
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed May 6 23:42:32 2020 -0400

    actionbar: Add gtk_action_bar_remove
    
    This is a replacement for gtk_container_remove.

 docs/reference/gtk/gtk4-sections.txt |  1 +
 gtk/gtkactionbar.c                   | 20 +++++++++++++++++---
 gtk/gtkactionbar.h                   |  4 ++++
 3 files changed, 22 insertions(+), 3 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index f9d6f0ce66..2614c38e5a 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -5557,6 +5557,7 @@ GtkActionBar
 gtk_action_bar_new
 gtk_action_bar_pack_start
 gtk_action_bar_pack_end
+gtk_action_bar_remove
 gtk_action_bar_get_center_widget
 gtk_action_bar_set_center_widget
 gtk_action_bar_get_revealed
diff --git a/gtk/gtkactionbar.c b/gtk/gtkactionbar.c
index 3435abb71c..e3e11a9c28 100644
--- a/gtk/gtkactionbar.c
+++ b/gtk/gtkactionbar.c
@@ -94,8 +94,8 @@ gtk_action_bar_add (GtkContainer *container,
 }
 
 static void
-gtk_action_bar_remove (GtkContainer *container,
-                       GtkWidget    *child)
+gtk_action_bar_real_remove (GtkContainer *container,
+                            GtkWidget    *child)
 {
   GtkActionBar *self = GTK_ACTION_BAR (container);
 
@@ -212,7 +212,7 @@ gtk_action_bar_class_init (GtkActionBarClass *klass)
   object_class->finalize = gtk_action_bar_finalize;
 
   container_class->add = gtk_action_bar_add;
-  container_class->remove = gtk_action_bar_remove;
+  container_class->remove = gtk_action_bar_real_remove;
   container_class->forall = gtk_action_bar_forall;
   container_class->child_type = gtk_action_bar_child_type;
 
@@ -308,6 +308,20 @@ gtk_action_bar_pack_end (GtkActionBar *action_bar,
   gtk_box_insert_child_after (GTK_BOX (action_bar->end_box), child, NULL);
 }
 
+/**
+ * gtk_action_bar_remove:
+ * @action_bar: a #GtkActionBar
+ * @child: the #GtkWidget to be removed
+ *
+ * Removes a child from @action_bar.
+ */
+void
+gtk_action_bar_remove (GtkActionBar *action_bar,
+                       GtkWidget    *child)
+{
+  gtk_action_bar_real_remove (GTK_CONTAINER (action_bar), child);
+}
+
 /**
  * gtk_action_bar_set_center_widget:
  * @action_bar: a #GtkActionBar
diff --git a/gtk/gtkactionbar.h b/gtk/gtkactionbar.h
index 38e23c2bea..5015ae4485 100644
--- a/gtk/gtkactionbar.h
+++ b/gtk/gtkactionbar.h
@@ -51,6 +51,10 @@ GDK_AVAILABLE_IN_ALL
 void         gtk_action_bar_pack_end          (GtkActionBar *action_bar,
                                                GtkWidget    *child);
 
+GDK_AVAILABLE_IN_ALL
+void         gtk_action_bar_remove            (GtkActionBar *action_bar,
+                                               GtkWidget    *child);
+
 GDK_AVAILABLE_IN_ALL
 void        gtk_action_bar_set_revealed       (GtkActionBar *action_bar,
                                                gboolean      revealed);


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