Re: Enable drag and drop for treeview?



On Sat, 2007-05-05 at 14:39 +0200, Jef Driesen wrote:
> Chris Vine wrote:
> > On Fri, 2007-05-04 at 09:20 +0200, Jef Driesen wrote:
> >> Does this method also work well with a sorted treemodel? Because the 
> >> simple set_reorderable() does not seem to work in that case. Once the 
> >> model is sorted (by clicking on a treeview column header), drag and drop 
> >> is not possible anymore.
> > 
> > You cannot drag and drop within any one sorted tree view, because it is
> > meaningless (you cannot change the order of one row against another in a
> > sorted view).  The same constraint would not arise when dragging between
> > widgets and should not be an issue, I imagine.  You could try it out
> > using Paul's approach.
> 
> I understand, but I was more thinking about a Gtk::TreeStore, where I 
> want to allow moving a subtree under another parent. Even if the model 
> is sorted, this type of move is still not mutually exclusive with the 
> sorting.

I see.  Whenever I use TreeStores, rather than simple ListStores, I go
down to the low level gtk/gdk dnd api (usually there is other book
keeping to be done anyway in such a case), so I don't know how the
standard high level interface handles this.

I suggest you try it with Paul's approach and see what happens.

Chris





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