views:

132

answers:

1

I have a simple gtk.TreeView with a gtk.ListStore model and set_reorderable(True), I want to catch the signal/event emited when the user reorder through drag&drop the list, but the documentation does not help much:

"The application can listen to these changes by connecting to the model's signals"

So I tried to connect the model (ListStore) signals... but surprise! ListStore has no signals, so you are dispatched to TreeModel signals, then I tried to connect with the TreeModel "rows-reordered" signal with no lucky.

How should I catch the list reorder performed by the user?

+1  A: 

There is no way to do that in PyGTK currently. "rows-reordered" is the correct signal, but it is impossible to derive any information from it in PyGTK other than "somehow reordered". In C GTK+ you could use the same signal and get the required information in callback, but not in Python.

doublep
But this signal is not emited in PyGTK, at least I could check manually the model if was emited.
mkotechno
@mkotechno: What exactly are you doing? If you drag'n'drop rows, "rows-reordered" is *not* sent, even if it looks like reordering from GUI. Instead, during drag'n'drop "row-deleted" and "row-inserted" signals are emitted.
doublep
This is what I needed to know, thanks.
mkotechno