Re: [gtkmm] how do I know when a row has been edited?



> void
> MyDialog::on_edited(const Glib::ustring& path,
>                     const Glib::ustring& text)
> {
>   // Check if the value has changed from its previous value...
>   {
>     Gtk::TreeModel::iterator cur =
>       m_tree_store->get_iter(Gtk::TreePath(path));

------------------------------------------------
I am stuck here. I don't have a m_tree_store...!
------------------------------------------------

>     Gtk::TreeModel::Row row = *cur;
>     if (row[list_columns.m_col_name] == text) // value is unchanged
>       return;
>   }
> 
>   // Do other stuff here...
> }


Tried this way:

  // two columns: ElementType (editable) and ID (not editable)
  int editableColumn = m_treeView.append_column_editable("Element Typ",
m_columns.m_elementType);
  m_treeView.append_column("Element ID",  m_columns.m_elementId);

  Gtk::CellRenderer *renderer =
m_treeView.get_column_cell_renderer(editableColumn);
  Gtk::CellRendererText *text_renderer =
dynamic_cast<Gtk::CellRendererText *>(renderer);
  if (text_renderer) {
	text_renderer->property_editable() = true;
	text_renderer->signal_edited().connect(slot(*this,
&ElementsTable::rowChangedCallback));
  }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]