GNOME Bugzilla – Bug 536699
Add gtk_combo_box_find_text()
Last modified: 2018-05-02 14:32:55 UTC
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: /** * gtk_combo_box_find_text: * @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.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/294.