Only NSOperationCopy?
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