[gtk+] comboboxtext: Add gtk_combo_box_text_remove_all()



commit 5862075e9dbf6ce76b9b18f250d4694ecafe85e5
Author: Christian Dywan <christian twotoasts de>
Date:   Thu Oct 21 14:25:08 2010 +0200

    comboboxtext: Add gtk_combo_box_text_remove_all()
    
    https://bugzilla.gnome.org/show_bug.cgi?id=324899

 docs/reference/gtk/gtk3-sections.txt |    1 +
 gtk/gtk.symbols                      |    1 +
 gtk/gtkcomboboxtext.c                |   19 +++++++++++++++++++
 gtk/gtkcomboboxtext.h                |    1 +
 4 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/gtk/gtk3-sections.txt b/docs/reference/gtk/gtk3-sections.txt
index 2cb1d8e..a36ef79 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
 
 <SUBSECTION Standard>
diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols
index 88de0b8..6def240 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 2af9d3f..25400de 100644
--- a/gtk/gtkcomboboxtext.c
+++ b/gtk/gtkcomboboxtext.c
@@ -249,6 +249,25 @@ gtk_combo_box_text_remove (GtkComboBoxText *combo_box,
 }
 
 /**
+ * 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 3791fa5..50ebcb5 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);
 
 



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