Re: NSDragOperationMove type drag&drop in outline views
Re: NSDragOperationMove type drag&drop in outline views
- Subject: Re: NSDragOperationMove type drag&drop in outline views
- From: Allan Odgaard <email@hidden>
- Date: Wed, 15 Sep 2004 23:57:14 +0200
On 15. Sep 2004, at 23:09, Robert Goldsmith wrote:
Maybe I have misread the docs and I actually need to keep track of
this myself (and, if so, how, when I am simply handed an array of
items which could have come from anywhere...)
You can query the data source for the sender to see if it's a local
drag'n'drop.
[...] but I can't find anything that sounds sensible :(
You unfortunately need to handle drag-sorting yourself, what I do is
something like mark all the items in the array, i.e.:
"[arrayOfDraggedItems setValue:@"mark" forKey:@"_delete"]", then I
iterate through all the items, and remove those with the mark, remove
the mark again, and then insert the items.
Though two subtleties here: keep track of where to insert items after
having removed the dragged items and ensuring that an items is not
dragged into a descendent of itself (this has to happen while
validating the proposed drop).
--
http://macromates.com/ ::: TextMate, OS X text editor
http://macromates.com/sigpipe/ ::: Personal weblog about
programming
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden