• 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
Only NSOperationCopy?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Only NSOperationCopy?


  • Subject: Only NSOperationCopy?
  • From: Mark Dawson <email@hidden>
  • Date: Sat, 12 Mar 2005 16:19:42 -0800

I've just started implementing dragging (both move & copy). However, I'm having trouble figuring out what I need to do to implement a drag-move (vs a drag-copy). I've inherited some drag and drop code that allowed dropping, but not drag moving. Right now a drag shows up as a copy (arrow with "+") and NSDragOperationCopy is passed to concludeDragOperation.

I do have:
- (unsigned BOOL)isLocal
{
if (isLocal)
return NSDragOperationCopy | NSDragOperationMove;
else // allow dragging into trash for deleting
return NSDragOperationCopy | NSDragOperationDelete;
}
- (id <NSDraggingInfo>)sender {
return YES;
}

- (id <NSDraggingInfo>)sender {
return YES;
}

I've implemented dragImage:at in the mouseDown method.

The code also has dragOperationForDraggingInfo implemented. This returns NSDragOperationCopy, which could be the problem. However, the docs (http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/ObjC_classic/Classes/NSTextView.html#//apple_ref/doc/uid/20000373/dragOperationForDraggingInfo_type_) say that only NSDragOperationCopy can be returned (vs NSDragOperationMove). If I just return NSDragOperationNone from it, all I get is a snap-back from my mouse-up (concludeDragOperation isn't called).

What do I need to do get get drag moving working, with drag copy only happening with the option key down?

Thanks!

mark
 _______________________________________________
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

  • Prev by Date: [warning, newbie] a new, saved, opened and closed again window causes app to crash (EXC_BAD_ACCESS)
  • Next by Date: [warning, newbie] a new, saved, opened and closed again window causes app to crash (EXC_BAD_ACCESS)
  • Previous by thread: [warning, newbie] a new, saved, opened and closed again window causes app to crash (EXC_BAD_ACCESS)
  • Next by thread: Is NSStringFromRect localized?
  • Index(es):
    • Date
    • Thread