Submitted by Claudio Saavedra
Given that we have gtk_combo_box_new_text() and friends, that provide with a handy way to create simple combobox, it could be helpful to count with a gtk_combo_box_text_find() function that returns the index of the first occurrence of a text in a combobox create with gtk_combo_box_new_text() or gtk_combo_box_entry_new_text().
It must be noticed that an application developer can't implement this without assuming that the text is stored in the first column of the model. That shouldn't be necessary.
The proposed function is something like:
- @combobox: A #GtkComboBox created with gtk_combo_box_new_text()
- or gtk_combo_box_entry_new_text().
- @text: A string.
- Finds the first occurrence of @text in @combo. If @text is not in combo,
- it returns -1.
- Returns: The index for the first occurrence of @text in @combo, or -1. **/ gint gtk_combo_box_find_text (GtkComboBox *combobox, const gchar *text);
If you think this is worth adding I can prepare a patch. I already have an application side implementation.