The chosen item
| Chapter 13. Combo Boxes |

## The chosen item

To discover what item, if any, the user has chosen from the ComboBox, call `ComboBox::get_active()`. This returns a `TreeModel::iterator` that you can dereference to a `Row` in order to read the values in your columns. For instance, you might read an integer ID value from the model, even though you have chosen only to show the human-readable description in the ComboBox. For instance:

    Gtk::TreeModel::iterator iter = m_Combo.get_active();
    if(iter)
    {
      auto row = *iter;

      //Get the data for the selected row, using our knowledge
      //of the tree model:
      auto id = row[m_Columns.m_col_id];
      set_something_id_chosen(id); //Your own function.
    }
    else
      set_nothing_chosen(); //Your own function.

Chapter 13. Combo Boxes |  | Responding to changes