treemodelcustom and set_value_impl
- From: eric jrdn <eric_jrdn2 yahoo fr>
- To: gtkmm-list gnome org
- Subject: treemodelcustom and set_value_impl
- Date: Thu, 16 Nov 2006 14:43:13 +0100 (CET)
Hi,
I wish to modify the treemodelcustom example from gtkmm, and let the columns be editable.
First, i did :
m_TreeView.append_column_editable( "one", m_refTreeModel->get_model_column(0) );
m_TreeView.append_column_editable( "two", m_refTreeModel->get_model_column(1) );
m_TreeView.append_column_editable( "three", m_refTreeModel->get_model_column(2) );
instead of m_reTreeView.append(...) in examplewindow.cc
next, a set_value_impl must be implemented. I did this :
void ExampleTreeModel::set_value_impl(const iterator& iter, int column, const Glib::ValueBase& value)
{
if(iter_is_valid(iter))
{
typeListOfRows::const_iterator dataRowIter = get_data_row_iter_from_tree_row_iter(iter);
const Glib::Value<std::string>* tmp = static_cast<const
Glib::Value<std::string>*>(&value);
std::string value_specific;
value_specific=tmp->get();
int row_index = (int)iter.gobj()->user_data;
Gtk::TreePath tp;
tp.push_front(row_index);
typeRow dataRow = *dataRowIter;
dataRow[column]=value_specific;
row_changed(tp,iter);
}
}
I know that the data are modified, but the Treeview does not update. Does anyone knows what i'm missing? On another test case, row_deleted and row_inserted do their job fine...
Thanks
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur
Yahoo! Questions/Réponses.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]