This is driving me nuts !
I am trying to figure out how you get the text from the selection of a combobox (note: not combo entry box)
I have populated the combobox Ok by attaching a liststore to it :
Code:
// set up model for combo box
m_refComboModel = Gtk::ListStore::create(m_Combo);
viewComboBox->set_model(m_refComboModel);
viewComboBox->pack_start(m_Combo.view_col);
// Set the 3 default values for the combobox
Gtk::TreeModel::Row row = *(m_refComboModel->append());
row[m_Combo.view_col] = "item 1";
row = *(m_refComboModel->append());
row[m_Combo.view_col] = "item 2";
row = *(m_refComboModel->append());
row[m_Combo.view_col] = "item 3";
I have a signal that is generated if the user make a selection from the combobox in the following function :
Code:
//---------------------------------------------
// User has selcted new positon in combo box
//--------------------------------------------
void window1::on_viewComboBox_changed()
{
// get the current selection from the combobox
// to do ........................................................
TreeModel::iterator i = viewComboBox->get_active();
}
tried variuos ways but I can not figure out how to get the item selected.
get_active always returns 1.
Can anybody show me the light (preferably with an example)
Regards
Shmonkey