Re: Dragging file promises

Christiaan Hofman <[email protected]> Sat, 6 Oct 2012 22:45:45 +0200
Newsgroups gmane.comp.macosx.devel
Message-ID <[email protected]>
On Oct 6, 2012, at 21:35, Fritz Anderson wrote:

> On 6 Oct 2012, at 6:24 AM, Christiaan Hofman <[email protected]> =
wrote:
>=20
>> I am trying to figure out how to drag file promises from views such =
as NSTableView. Before 10.6, I knew how to do this using =
NSFilesPromisePboardType and the =
namesOfPromisedFilesDroppedAtDestination: delegate methods.
>=20
> I'm having trouble getting my head around any of this. For instance, -
> namesOfPromisedFilesDroppedAtDestination: isn't a delegate method, but =
a part of a protocol.

A protocol for a delegate (it's not a delegate you set explicitly, but =
the dragging source is implicitly used as the delegate for the drag =
operation.) Moreover, a corresponding method is a delegate (or more =
precisely datasource) method for NSTableView, which is really what it =
passes through in the end of the drop.

> And I don't see how NSTableView would know to call dragPromised... =
"implicitly," given that it never knows that it contains things that =
could me converted into file promises.
>=20

If you put a NSFilesPromisePboardType on the dragging pasteboard from =
the NSTableView datasource method =
tableView:writeRowsWithIndexes:toPasteboard:  (remember, I am talking =
about dragging, and this is how you start a drag from NSTableView), then =
promised files are dragged automatically, which should go through the =
view method implicitly (i.e. you don't have to do that yourself, =
NSTableView does this for you.) And at the drop the =
namesOfPromisedFiles... method is called.


> Could you post your code, please?
>=20
> 	=97 F

It really should not matter that much what the code is. The bottom line =
from this is that I say that I know how to drag file promises using the =
old API. And my question is how to drag file promises using the new API =
and UTIs. I did not go into detail, and really think I shouldn't, =
because anyone who could answer my question would know what I am talking =
about, and the code should be straightforward but tedious. So if you =
don't know what I am talking about, you almost certainly won't be able =
to answer my question.

Christiaan