Combo

A Combo is a combination of a text entry and a popup menu. Clicking on one of the menu entries puts it in the entry box. The entry box otherwise works just like a regular Entry widget.

A Gtk::Combo contains a Gtk::Entry widget, which is used to implement the entry box. You can obtain the Gtk::Entry using get_entry() method.

To set the values in the popup menu, use

void Gtk::Combo::set_popdown_strings(const Gtk::SArray& strings);
where strings is a list of the strings you want to appear in the list. As mentioned in the Basics section, Gtk::SArray is a converter object which can take any kind of STL vector container. This means that you can pass vectors or lists to this method, and things will work as you expect. For example, the following is legal:

list<string> gl;

gl.push_back("String 1");
gl.push_back("String 2");
gl.push_back("String 3");
gl.push_back("String 4");

combo.set_popdown_strings(gl);

TODO: STL-style access.

Reference

Example

Figure 6.3. Combo

Source Code