Gtk2_IndexedComboBox

Gtk2_IndexedComboBox is a Gtk2 widget similar to the HTML select box - it lets you not only store values as the normal GtkComboBox, but associated key/value pairs.

Gtk2_IndexedComboBox is meant to be as easy to use as possible, and to have an API similar to the combo boxes created with GtkComboBox::new_text(). You can directly add key/value pairs to the widget instead of using the model (which is possible, too). Retrieving the currently selected key can be done with a single method call.

Both keys and values can be strings, thus allowing integers implicitly. This is very useful if you need a widget to select some row ID from a database, but want to display some descriptive string. By default, a single GtkCellRendererText is used as cell renderer.

Table of Contents