diff --git a/docs/reference/gtk/gtk3-sections.txt b/docs/reference/gtk/gtk3-sections.txt index 2cb1d8e7ca..a36ef790b3 100644 --- a/docs/reference/gtk/gtk3-sections.txt +++ b/docs/reference/gtk/gtk3-sections.txt @@ -820,6 +820,7 @@ gtk_combo_box_text_append_text gtk_combo_box_text_insert_text gtk_combo_box_text_prepend_text gtk_combo_box_text_remove +gtk_combo_box_text_remove_all gtk_combo_box_text_get_active_text diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols index 88de0b8f65..6def240fd9 100644 --- a/gtk/gtk.symbols +++ b/gtk/gtk.symbols @@ -842,6 +842,7 @@ gtk_combo_box_text_new gtk_combo_box_text_new_with_entry gtk_combo_box_text_prepend_text gtk_combo_box_text_remove +gtk_combo_box_text_remove_all #endif #endif diff --git a/gtk/gtkcomboboxtext.c b/gtk/gtkcomboboxtext.c index 2af9d3f608..25400debe5 100644 --- a/gtk/gtkcomboboxtext.c +++ b/gtk/gtkcomboboxtext.c @@ -248,6 +248,25 @@ gtk_combo_box_text_remove (GtkComboBoxText *combo_box, gtk_list_store_remove (store, &iter); } +/** + * gtk_combo_box_text_remove_all: + * @combo_box: A #GtkComboBoxText + * + * Removes all the text entries from the combo box. + * + * Since: 3.0 + */ +void +gtk_combo_box_text_remove_all (GtkComboBoxText *combo_box) +{ + GtkListStore *store; + + g_return_if_fail (GTK_IS_COMBO_BOX_TEXT (combo_box)); + + store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (combo_box))); + gtk_list_store_clear (store); +} + /** * gtk_combo_box_text_get_active_text: * @combo_box: A #GtkComboBoxText diff --git a/gtk/gtkcomboboxtext.h b/gtk/gtkcomboboxtext.h index 3791fa5082..50ebcb501c 100644 --- a/gtk/gtkcomboboxtext.h +++ b/gtk/gtkcomboboxtext.h @@ -69,6 +69,7 @@ void gtk_combo_box_text_prepend_text (GtkComboBoxText *combo_box const gchar *text); void gtk_combo_box_text_remove (GtkComboBoxText *combo_box, gint position); +void gtk_combo_box_text_remove_all (GtkComboBoxText *combo_box); gchar *gtk_combo_box_text_get_active_text (GtkComboBoxText *combo_box);