Re: Drag and drop file problems
Re: Drag and drop file problems
- Subject: Re: Drag and drop file problems
- From: 陳銘崧 a.k.a. James Chen <email@hidden>
- Date: Mon, 22 Nov 2004 09:54:21 +0800
Hi,
I have an idea.
You could try to use the - (BOOL)dragPromisedFilesOfTypes:(NSArray
*)typeArray fromRect:(NSRect)aRect source:(id)sourceObject
slideBack:(BOOL)slideBack event:(NSEvent *)theEvent of NSView, although
those dragged files already exist.
And then implement - (NSArray
*)namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination of
NSDraggingSource.
So that you could know where those files gonna be, then you could
handle this.
HTH,
James
------------------------------------
Ulead Systems Inc.
James Chen
Software Engineer
Image Div.
------------------------------------
On Nov 18, 2004, at 6:57 AM, Christoffer Lerno wrote:
I'm trying to move files by drag and drop from my application to the
Finder.
In my application I have a representation of files in a certain
folder. I want to be able to drop those into the Finder using drag and
drop.
In the normal case this works fine. I use
draggedImage:endedAt:operation to remove the files just dragged into
the finder folder.
Problem occurs when I want to move a file which already exists in the
target folder in the Finder. (For example, let us say I want to drop
"untitled.txt" on the desktop which already contains an
"untitled.txt")
The Finder then launches a dialog asking whether to replace or to stop
the operation, however this is done _after_ the finder has given my
app a draggedImage:endedAt:operation call. So my application believes
the file is now moved and removes it from display. However, pressing
"stop" prevents the file from being moved, so the file is actually
still there. :-/
Is there some way to get around this?
/Christoffer
_______________________________________________
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
_______________________________________________
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