[Gtk-sharp-list] TreeView simple drag-and-drop to sort rows

Sebastian scut at nb.in-berlin.de
Thu Oct 20 11:38:24 EDT 2005


I am using a TreeView that uses a simple Gtk.ListStore, storing two 
strings per row, that are rendered with a CellRendererText.

I enabled TreeView.Reorderable in the TreeView, bound the ListStore to 
the TreeView and display them all in a GUI.  The display works perfectly 
and I can drag around rows easily and the change is reflected in the GUI.

To make sense in the underlying data-model I connect to the 
ListStore.RowsReordered event.  However, while dragging/dropping still 
works, the connected function is never called.

What am I missing?  Do I additionally have to enable drag-and-drop somehow?

(I looked in the banshee playlist code to see how they handle drag and 
drop, but as far as I see, they use a custom drag-and-drop using the 
Gtk.Drag.* namespace.  In the Gtk# docs it says, the standard 
ListStore's RowsReordered event should work just fine for the simple 
"row-within-one-TreeView" drag and drop I want to do.)

Thanks in advance,

More information about the Gtk-sharp-list mailing list