[Gtk-sharp-list] DND reordering in treeview

Gankov gankov.andrey at inbox.ru
Sat May 18 09:07:52 UTC 2013


Hello

I have treeview with two levels of tree, i want allow user reorder items
with Drag and Drop. I set reorderable property to true, and it works. But i
want to user can drag and drop only second level items, and can't drag first
level items.

I found that i can use RowDraggable and RowDropPossible method for it. I try
override these methods:
	class ImageTreeStore : Gtk.TreeStore, TreeDragSourceImplementor,
TreeDragDestImplementor
	{
		public ImageTreeStore(params Type[] types) : base (types)
		{
	
		}

		public new bool RowDraggable (TreePath path)
		{
			return path.Depth == 2;
		}

		public new bool RowDropPossible(TreePath path, SelectionData sel)
		{
			return path.Depth == 2;
		}

		public new bool DragDataGet(TreePath path, SelectionData sel)
		{
			return true;
		}
	}

If i didn't override DragDataGet too, application fail.
But reordering by DND don't works. I can't found any examples or manuals how
use RowDraggable with standard reorder function of treeview. Please help
understand how use it or give me link on code that use it.



--
View this message in context: http://mono.1490590.n4.nabble.com/DND-reordering-in-treeview-tp4659700.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.


More information about the Gtk-sharp-list mailing list