[gtk+/gtk-2-24] GtkComboBox(Text): Add documentation about the entry



commit 67d042f02b0516cc6fbc97d388d79b4fec12f555
Author: Milan Bouchet-Valat <nalimilan club fr>
Date:   Thu Jan 6 12:57:59 2011 -0500

    GtkComboBox(Text): Add documentation about the entry

 gtk/gtkcombobox.c     |    7 ++++++-
 gtk/gtkcomboboxtext.c |    8 +++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 47637ba..acafa1a 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -74,9 +74,14 @@
  * not restricted to a flat list, it can be a real tree, and the popup will
  * reflect the tree structure.
  *
+ * To allow the user to enter values not in the model, the 'has-entry'
+ * property allows the GtkComboBox to contain a #GtkEntry. This entry
+ * can be accessed by calling gtk_bin_get_child() on the combo box.
+ *
  * For a simple list of textual choices, the model-view API of GtkComboBox
  * can be a bit overwhelming. In this case, #GtkComboBoxText offers a
- * simple alternative.
+ * simple alternative. Both GtkComboBox and #GtkComboBoxText can contain
+ * an entry.
  */
 
 /* WELCOME, to THE house of evil code */
diff --git a/gtk/gtkcomboboxtext.c b/gtk/gtkcomboboxtext.c
index ea508b6..bfa0377 100644
--- a/gtk/gtkcomboboxtext.c
+++ b/gtk/gtkcomboboxtext.c
@@ -41,6 +41,11 @@
  * gtk_combo_box_text_append_text(), gtk_combo_box_text_insert_text()
  * or gtk_combo_box_text_prepend_text() and remove options with
  * gtk_combo_box_text_remove_text().
+ *
+ * If the GtkComboBoxText contains an entry (via the 'has-entry' property),
+ * its contents can be retrieved using gtk_combo_box_text_get_active_text().
+ * The entry itself can be accessed by calling gtk_bin_get_child() on the
+ * combo box.
  */
 
 G_DEFINE_TYPE (GtkComboBoxText, gtk_combo_box_text, GTK_TYPE_COMBO_BOX);
@@ -256,7 +261,8 @@ gtk_combo_box_text_remove (GtkComboBoxText *combo_box,
  * @combo_box: A #GtkComboBoxText
  *
  * Returns the currently active string in @combo_box or %NULL if none
- * is selected.
+ * is selected. If @combo_box contains an entry, this function will return
+ * its contents (which will not necessarily be an item from the list).
  *
  * Returns: a newly allocated string containing the currently active text.
  *     Must be freed with g_free().



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