How to set GtkTreeView lines editable

614e86e799bfd891cc3b602de5f80bdc.png
1. create
GtkTreeView
;
2. add the columns using
GtkTreeViewColumn
and what type this will render with
GtkCellRendererText
;
3. create model
GtkListStore
, that will store the values;
4. add model to the treeview;
5. use
GtkListStore::append
to add values to model, and the data will appear on treeview;
6. now set
GtkCellRendererText
editable using
GtkCellRendererText::set_property("editable", TRUE)
;
7. connect
GtkCellRendererText
to
edited
signal;
8. when
GtkCellRendererText
was edited, this method is called passing the
$path
and
$new_text
;
9. get the
$iter
from passed
$path
using
GtkTreeModel::get_iter_from_string($path)
;
10. now you can edit the
GtkTreeModel
value using
GtkTreeModel::set_value($iter, $column, $new_text)
;