Re: Dragging a file out of an NSTableView
Re: Dragging a file out of an NSTableView
- Subject: Re: Dragging a file out of an NSTableView
- From: Mason Mark <email@hidden>
- Date: Wed, 26 Mar 2003 02:21:55 -0800
This issue has come up several times. Sorry, I don't have the answer,
just adding my $0.02 worth of "weight" to this thread.
There is a serious API shortcoming here, one of the more serious Cocoa
shortcomings that still exists, I think.
The AppKit release notes say that calling -[NSView
dragPromisedFilesOfTypes:fromRect:source:slideBack:event:] will also
"write a private type necessary to allow the destination to ask for the
filenames when the drag is dropped".
That might be one reason your attempt to create the promise from scratch
does not work.
I would like to see the promised files API brough updated to work as one
would expect within the well-established Cocoa pasteboard/drag&drop
system.
While waiting, it would be cool if Apple provided a workaround. I have
exactly the same need as you, except I need to also be able to include
standard text pasteboard types (filenames) and also internal private
pasteboard types. So I'd really like it if HFS Promise drags worked like
all the other kinds of drags...
I'd encourage you to join those of us who've filed bugs on this issue. ;-)
Best regards,
--
Mason Mark
Five Speed Software, Inc.
Chris Hanson wrote:
I need to drag a file - generated on the fly - out of an NSTableView and
into the Finder.
I think the way to do this will be to generate a file promise. However,
I'm using an NSTableView, so I can't simply override -[NSView
dragPromisedFilesOfTypes:fromRect:source:slideBack:event:]. OK, I figure
I'll attempt to create a promise from scratch. In handling the drag in
the table in my table data source, I use:
[pasteboard declareTypes:
[NSArray arrayWithObject:NSFilesPromisePboardType]
owner:self];
success = [pasteboard setPropertyList:
[NSArray arrayWithObject:@"myExtensio"]
forType:NSFilesPromisePboardType];
And then in my NSTableView subclass, I override
-namesOfPromisedFilesDroppedAtDestination:. (In doing so I'm assuming
that in a drag initiated by an instance of NSTableView, that the
NSTableView instance is the drag's owner.) However, the Finder refuses
my drag.
Does anyone have any suggestions as to how to go about this? I'm
running out of ideas.
-- Chris
_______________________________________________
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.