TreeView/ListStore reordering by DND



I have a simple list display built of a ListView and ListStore as
described in
https://developer.gnome.org/gtk3/stable/GtkTreeView.html

I used gtk_tree_view_set_reorderable () to allow the user to reorder the
list by grabbing rows and moving it up or down.

From 

https://developer.gnome.org/gtk3/stable/GtkTreeView.html#gtk-tree-view-set-reorderable

we have:

"The developer can listen to these changes by connecting to the model's
row_inserted and row_deleted signals."

It seems that a "row_inserted" signal is emitted followed by a
"row_deleted" signal.

But how can I detect the row numbers of the two exchanged rows?

gtk_tree_path_get_indices ()
https://developer.gnome.org/gtk3/stable/GtkTreeModel.html#gtk-tree-path-get-indices

may work in the signal handler? But it is not very easy to find the
relation between the two exchanged rows and the indices.

Are better options available?




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