[gtk/kill-containers: 27/49] listbox: Add gtk_list_box_remove
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/kill-containers: 27/49] listbox: Add gtk_list_box_remove
- Date: Tue, 12 May 2020 01:59:13 +0000 (UTC)
commit 0d71bd66880c63f4c0003a8c685d56182b04212e
Author: Matthias Clasen <mclasen redhat com>
Date: Fri May 8 01:50:37 2020 -0400
listbox: Add gtk_list_box_remove
This is a gtk_container_remove replacement.
docs/reference/gtk/gtk4-sections.txt | 1 +
gtk/gtklistbox.c | 16 ++++++++++------
gtk/gtklistbox.h | 3 +++
3 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index 22d212a887..aec527c5ba 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -274,6 +274,7 @@ GtkListBoxUpdateHeaderFunc
gtk_list_box_new
gtk_list_box_prepend
gtk_list_box_insert
+gtk_list_box_remove
gtk_list_box_select_row
gtk_list_box_unselect_row
gtk_list_box_select_all
diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c
index 6068c5334e..74a413ffb1 100644
--- a/gtk/gtklistbox.c
+++ b/gtk/gtklistbox.c
@@ -250,8 +250,6 @@ static GtkListBoxRow *gtk_list_box_get_first_focusable (GtkListBo
static GtkListBoxRow *gtk_list_box_get_last_focusable (GtkListBox *box);
static void gtk_list_box_add (GtkContainer *container,
GtkWidget *widget);
-static void gtk_list_box_remove (GtkContainer *container,
- GtkWidget *widget);
static void gtk_list_box_forall (GtkContainer *container,
GtkCallback callback,
gpointer callback_target);
@@ -2270,12 +2268,18 @@ gtk_list_box_add (GtkContainer *container,
gtk_list_box_insert (GTK_LIST_BOX (container), child, -1);
}
-static void
-gtk_list_box_remove (GtkContainer *container,
+/**
+ * gtk_list_box_remove:
+ * @box: a #GtkListBox
+ * @child: the child to remove
+ *
+ * Removes a child from @box.
+ */
+void
+gtk_list_box_remove (GtkListBox *box,
GtkWidget *child)
{
- GtkWidget *widget = GTK_WIDGET (container);
- GtkListBox *box = GTK_LIST_BOX (container);
+ GtkWidget *widget = GTK_WIDGET (box);
gboolean was_visible;
gboolean was_selected;
GtkListBoxRow *row;
diff --git a/gtk/gtklistbox.h b/gtk/gtklistbox.h
index 57f26f8c3b..ddeb62b6ab 100644
--- a/gtk/gtklistbox.h
+++ b/gtk/gtklistbox.h
@@ -172,6 +172,9 @@ void gtk_list_box_insert (GtkListBox
GtkWidget *child,
gint position);
GDK_AVAILABLE_IN_ALL
+void gtk_list_box_remove (GtkListBox *box,
+ GtkWidget *child);
+GDK_AVAILABLE_IN_ALL
GtkListBoxRow* gtk_list_box_get_selected_row (GtkListBox *box);
GDK_AVAILABLE_IN_ALL
GtkListBoxRow* gtk_list_box_get_row_at_index (GtkListBox *box,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]