After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 145904 - empty model in combobox should be handled better
empty model in combobox should be handled better
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkComboBox
unspecified
Other Linux
: Normal enhancement
: Small API
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 710710
 
 
Reported: 2004-07-08 21:07 UTC by Matthias Clasen
Modified: 2018-05-02 14:02 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Matthias Clasen 2004-07-08 21:07:21 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
Comment 1 Federico Mena Quintero 2004-07-09 01:35:23 UTC
gtk_combo_box_set_empty_text (combo_box, "No items"), perhaps?

The GIMP people may have other thoughts about this; CCing Sven.
Comment 2 Sven Neumann 2004-07-09 06:29:39 UTC
Yes, that API should be sufficient for our needs.
Comment 3 Matthias Clasen 2004-07-09 18:52:38 UTC
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...
Comment 4 Sven Neumann 2005-02-27 21:21:09 UTC
Allow a special value in the associated tree-model then? And wrap this for the
simple text-only combo box?
Comment 5 Murray Cumming 2007-05-04 20:52:25 UTC
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.
Comment 6 Sven Herzberg 2008-02-11 14:42:25 UTC
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.
Comment 7 Daniel Boles 2017-03-03 14:30:59 UTC
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?
Comment 8 GNOME Infrastructure Team 2018-05-02 14:02:25 UTC
-- 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.