• 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: Drag & Drop: PREVENT file move
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drag & Drop: PREVENT file move


  • Subject: Re: Drag & Drop: PREVENT file move
  • From: Nathan Vander Wilt <email@hidden>
  • Date: Thu, 11 Dec 2008 15:37:58 -0800


On Dec 11, 2008, at 3:11 PM, Houdah - ML Pierre Bernard wrote:

Hi!

My application shows a list of files in a table view.

I have implemented drag and drop so that users may drag files from the list. I could envision them dragging the files onto other applications for viewing or dragging them on a removable media to create archive copies.

The problem occurs when the user drags the file to another folder on the same disk. By default, the Finder then wants to move the file. I need to prevent just that as it will cause havoc. For one, I would lose track of the file.

Is there a way for the originating application to control the allowed drag operations?


Check out NSDraggingSource protocol's - draggingSourceOperationMaskForLocal:. You should be able to return something like (NSDragOperationCopy | NSDragOperationLink) if you want to make sure the original file stays in the same place. If you don't mind the file being moved so long as you know its no longer available, you could instead implement -(void)draggedImage:(NSImage*)anImage endedAt:(NSPoint)aPoint operation:(NSDragOperation)operation to be notified when a move/delete is completed.


hope this helps, -natevw

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Drag & Drop: PREVENT file move (From: Houdah - ML Pierre Bernard <email@hidden>)

  • Prev by Date: Re: Is it useful to make a 64 bit app? [Was]: How can users check if their mac is 64-bit-capable?
  • Next by Date: Re: Announce the time every 30 minutes
  • Previous by thread: Drag & Drop: PREVENT file move
  • Next by thread: Announce the time every 30 minutes
  • Index(es):
    • Date
    • Thread