As you noticed "editing-started" is used at the beginning of editing a cell
as the documentation states and is defined on the base class

This signal gets emitted when a cell starts to be edited. The intended use
of this signal is to do special setup on *editable* , e.g. adding a
<> or
setting up additional columns in a GtkComboBox

While "edited" is only available on  GtkCellRendererText and is mainly to
be used for "simple" edition of text (called when user validates
In case you have a GtkCellRendererText the signals will be called like this:
- editing-started
if user validates
   - edited with new_text the string the user entered
else (user cancel edition)
   - editing-canceled
In all cases you only have the path of the edited row, since the
cellrenderer does not "know" the model it is displaying : you have to pass
it through the signal user_data (then you can build the iter and do your
edition code)

Le jeu. 28 févr. 2019 à 18:43, Mike Martin <> a écrit :

> Thanks
> Though what I don't quite get is the difference in behaviour between
> editing-started and edited (both using path to get the ITER)
> On my particular scenario I use editing-started to setup some stuff so I
> can use the iter created
> On Thu, 28 Feb 2019, 12:30 Nicolas Soubeiran via gtk-app-devel-list, <
>> wrote:
>> Hello,
>> after you sort the model, you shall consider that all iter and path
>> previously stored are wrong :
>> A path is a representation of the position of the row in the current case
>> (which you can read by using gtk_tree_path_to_string).
>>  Iter are quite the same (but link to a particular GtkTreeModel), such as
>> list::iterator of C++ STL : they are pointer to row that you can use to
>> access to data or walk through the models.  You can make an iter from a
>> path and a model :
>> GtkTreePath *path;GtkTreeIter iter;
>> GtkTreeModel* model;
>> GtkListStore store = gtk_list_store_new(3, G_TYPE_INT,
>> model = GTK_TREE_MODEL(store);
>> path = gtk_tree_path_new_from_string
>> <
>> >
>> ("3"); // third rowgtk_tree_model_get_iter
>> <
>> >
>> (model, &iter, path); // may be invalid (check return value)
>>  If you really want to keep track of a particular row, you have to use
>> GtkTreeRowReference
>> But GTK will have to keep the reference up to date, so each time your
>> model change (inserting, deleting, sorting...)
>> GTK will triggered signal to update your GtkTreeRowReference which may
>> cause an overhead in your application
>> Hope this helps you to understand better the GtkTreeModel paradigm
>> _______________________________________________
>> gtk-app-devel-list mailing list
gtk-app-devel-list mailing list

Reply via email to