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 619148 - "active ID" properties (GtkComboBox)
"active ID" properties (GtkComboBox)
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkComboBox
unspecified
Other All
: Normal enhancement
: 3.0
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2010-05-19 23:37 UTC by Allison Karlitskaya (desrt)
Modified: 2010-11-30 15:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (11.91 KB, patch)
2010-10-23 17:34 UTC, Matthias Clasen
none Details | Review

Description Allison Karlitskaya (desrt) 2010-05-19 23:37:40 UTC
GtkComboBox should support having the rows in it be named with ID strings.

It would work this way:

first, we have a "id-column" property.  It is -1 by default, but if it is non-negative then it specifies a column in the GtkTreeModel that is used as the "id" column.  It must be a string.

Then we have a "active-id" property.

When you get this, it returns the contents of the id column on the active row.

When you set it, it searches for which row has the given id, and sets it as active.
Comment 1 Matthias Clasen 2010-05-21 16:08:18 UTC
Sounds plausible. Needs a patch, though
Comment 2 Matthias Clasen 2010-10-23 17:34:28 UTC
Created attachment 173086 [details] [review]
patch

Is this what you had in mind ? 

I wasn't entirely happy with it, so I left it out for now.
Comment 3 Allison Karlitskaya (desrt) 2010-11-30 15:54:54 UTC
Committed an updated patch.