listbox: Add _append

To have easy replacement API for gtk_container_add.
This commit is contained in:
Timm Bäder 2020-08-01 15:26:28 +02:00
parent b37b85333d
commit f5af18738b
3 changed files with 20 additions and 0 deletions

View File

@ -257,6 +257,7 @@ GtkListBoxUpdateHeaderFunc
gtk_list_box_new gtk_list_box_new
gtk_list_box_prepend gtk_list_box_prepend
gtk_list_box_append
gtk_list_box_insert gtk_list_box_insert
gtk_list_box_remove gtk_list_box_remove
gtk_list_box_select_row gtk_list_box_select_row

View File

@ -2584,6 +2584,22 @@ gtk_list_box_prepend (GtkListBox *box,
gtk_list_box_insert (box, child, 0); gtk_list_box_insert (box, child, 0);
} }
/**
* gtk_list_box_append:
* @box: a #GtkListBox
* @child: the #GtkWidget to add
*
* Append a widget to the list. If a sort function is set, the widget will
* actually be inserted at the calculated position and this function has the
* same effect of gtk_container_add().
*/
void
gtk_list_box_append (GtkListBox *box,
GtkWidget *child)
{
gtk_list_box_insert (box, child, -1);
}
/** /**
* gtk_list_box_insert: * gtk_list_box_insert:
* @box: a #GtkListBox * @box: a #GtkListBox

View File

@ -168,6 +168,9 @@ GDK_AVAILABLE_IN_ALL
void gtk_list_box_prepend (GtkListBox *box, void gtk_list_box_prepend (GtkListBox *box,
GtkWidget *child); GtkWidget *child);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gtk_list_box_append (GtkListBox *box,
GtkWidget *child);
GDK_AVAILABLE_IN_ALL
void gtk_list_box_insert (GtkListBox *box, void gtk_list_box_insert (GtkListBox *box,
GtkWidget *child, GtkWidget *child,
int position); int position);