RE: TreeView/ListStore reordering by DND

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

 



The "row_inserted" and "row_deleted" signals in the GtkTreeModel are each called with the GtkTreePath of the row in question:

The "row-inserted" signal

void                user_function                      (GtkTreeModel *tree_model,
                                                        GtkTreePath  *path,
                                                        GtkTreeIter  *iter,
                                                        gpointer      user_data)


The "row-deleted" signal

void                user_function                      (GtkTreeModel *tree_model,
                                                        GtkTreePath  *path,
                                                        gpointer      user_data)

-----Original Message-----
From: gtk-list [mailto:gtk-list-bounces@xxxxxxxxx] On Behalf Of Stefan Salewski
Sent: Friday, February 28, 2014 5:33 PM
To: gtk-list@xxxxxxxxx
Subject: 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?


_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list




[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux