• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSDragOperationMove type drag&drop in outline views
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSDragOperationMove type drag&drop in outline views (From: Robert Goldsmith <email@hidden>)

  • Prev by Date: Re: How can my program be notified when a NSImageView is populated with a NSImage?
  • Next by Date: Re: NSDragOperationMove type drag&drop in outline views
  • Previous by thread: NSDragOperationMove type drag&drop in outline views
  • Next by thread: Re: NSDragOperationMove type drag&drop in outline views
  • Index(es):
    • Date
    • Thread