Re: Promised file drag/drop catch 22?
Re: Promised file drag/drop catch 22?
- Subject: Re: Promised file drag/drop catch 22?
- From: Tim Hewett <email@hidden>
- Date: Sun, 2 May 2004 10:08:27 +0100
Allan,
Thanks for the suggestion, it wasn't one spotted as a possibility to
this point. There is a problem though, since this is a promised file
drag rather than a normal "synchronous" one.
Unfortunately, for promised file drags, the NSDragging|Info
draggingSource
method doesn't return the dragging source view, it returns a
NSFilePromiseDragSource object. It is possible that this object provides
a means to discover the original view which is the dragging source,
but this class has no documentation, be it in the project include files
or
the XCode developer documentation, or developer.apple.com... An
attempt to treat the NSFilePromiseDragSource as the original view
fails:
*** -[NSFilePromiseDragSource tag]: selector not recognized
I guess the promised file drag mechanism always assumed that it would
be an inter-application mechanism, after all why would an application
ever want to promise an operation to itself? But unfortunately it isn't
possible to tell in advance whether a drop will be onto your own app
or a different one in advance of the drop being started, to be able to
initiate a promised drag for drags to remote windows, and ordinary
drags for local ones. So far the only information which appears to be
available to the dragging source once the promised drag has been
dropped is the URL returned by the dragging destination, the point
at which the drag is dropped (which *could* be used too determine
if the drop occurred in any of your app's windows, though this seems
to involve quite a messy conversion of coordinate systems), and the
NSDragOperation. Unfortunately the NSDragOperation seems always
to be given as NSDragOperationMove even when at earlier stages
in the drag it is NSDragOperationPrivate... so that's not much help.
Sorry about the length of the mails, this is quite a hard problem to
describe! Any further suggestions would be much appreciated...
Cheers,
Tim Hewett, Coolatoola.com
On 2 May 2004, at 08:13, Allan Odgaard wrote:
On 1. May 2004, at 14:19, Tim Hewett wrote:
[...] a drop from one table view to the other requires different
behaviour to
that for a drop from the Finder, and the problem I'm having in
particular
is to do with having the table receiving the drop being able to tell
the
difference to implement this different behaviour.
Sorry, I did not read all of your letter, so I hope the above was the
essence of your problem. In performDragOperation you can send
draggingSource to the sender argument to get the actual view which is
sending the data. Have it e.g. implement some selector to identify
itself, which you can then send from performDragOperation, or you can
make use of the fact that source is nil when it is not in the same
application.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.