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 139582 - GtkComboBox should support data from trees as well as lists
GtkComboBox should support data from trees as well as lists
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkComboBox
2.4.x
Other All
: Normal enhancement
: future
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 148076
 
 
Reported: 2004-04-09 12:51 UTC by Matt Walton
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot of Mac OS X combo box showing tree structure of items (44.52 KB, image/png)
2004-07-26 07:14 UTC, Matt Walton
Details

Description Matt Walton 2004-04-09 12:51:21 UTC
GtkComboBox currently only accepts data from TreeModels which work in list
format i.e. GtkListStore. It would be extremely useful to be able to give
GtkComboBox a GtkTreeStore and have it render the data in an expected manner.

There is precedent for this kind of functionality, as it is present in Mac OS
X's Cocoa widgets, and the tree combo is used in the Add Bookmark sheet in
Safari in order to provide a good interface to choosing a folder to put the
bookmark in, which is a naturally tree-based structure. It would be useful for
similar applications in GTK+.
Comment 1 Jean Bréfort 2004-05-12 14:18:49 UTC
I also would appreciate such a functionality
Comment 2 Matthias Clasen 2004-07-26 04:58:02 UTC
What is the "expected manner" here ? 
Putting an actual tree in the popup, or have multiple popups, like submenus ?
Comment 3 Matt Walton 2004-07-26 07:09:32 UTC
My initial thought was as with Mac OS X, to have the tree render in the popup
itself. I'll attach a screenshot after I've written this comment to demonstrate
that kind of rendering.

That said, doing it in a submenu style may also work very well. If it would be
significantly easier to implement in that manner, it would certainly still be
useful. Giving the programmer a choice of one or the other might also be good,
but then there's the issue of UI consistency to worry about, as some would use
it and some wouldn't and it could end up causing confusion among the users, so
perhaps it's best to just do one (also less effort of course).
Comment 4 Matt Walton 2004-07-26 07:14:56 UTC
Created attachment 29890 [details]
Screenshot of Mac OS X combo box showing tree structure of items

Added screenshot of Mac OS X's combo box dropdown rendering items in a tree
(this is the one which appears in Camino's 'Add Bookmark' sheet, to select a
location for the bookmark to be filed in).
Comment 5 Matthias Clasen 2004-07-26 14:34:46 UTC
So, do I understand the screenshot correctly, that the tree is always fully
expanded on OS X, and expanders are not drawn ?
Comment 6 Matt Walton 2004-07-26 14:52:59 UTC
I believe so; I'm not yet very familiar with the Aqua interface toolkit on OS X,
but I've never seen one which can be collapsed or expanded. I think that kind of
functionality would be a bit strange in what is effectively a pop-up menu, which
is probably why they avoided it.
Comment 7 Matthias Clasen 2004-08-02 19:17:44 UTC
I have implemented trees in combo boxes in cvs HEAD now.