GNOME Bugzilla – Bug 145904
empty model in combobox should be handled better
Last modified: 2018-05-02 14:02:25 UTC
It has been proposed that the combo box should display a placeholder text in this case and not pop up the empty menu/list
gtk_combo_box_set_empty_text (combo_box, "No items"), perhaps? The GIMP people may have other thoughts about this; CCing Sven.
Yes, that API should be sufficient for our needs.
But it is not so simple, since we can have arbitrary cell renderers. It is not even guaranteed that there is a text cell renderer at all...
Allow a special value in the associated tree-model then? And wrap this for the simple text-only combo box?
Bug #382291 suggests that the GtkComboBox should just be dimmed when it is empty. But it would be nice to sometimes set some text to show. I guess a real-world example would be more compelling.
Would it be te total overkill to be able to supply an "empty-model" of which the first row would be displayed? I cannot actually think of an easier way to be able to support any cell layout.
It doesn't pop up an empty list anymore, since Bug 382291 was resolved, which desensitises the ComboBox for a 0-length model. It still pops up for a 1-item list, though, which isn't very useful; I opened Bug 775539 for that. anyway, a placeholder model seems like something best left to the user, no?
-- 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/235.