Pasteboard file promises under 10.6

2010-01-04 Thread Frank Illenberger
Does anybody know how to get file promises working with the new pasteboard API 
in Snow Leopard?
When the dragging session in started, I put the following item onto the 
provided pasteboard:

NSPasteboardItem* item = [[NSPasteboardItem alloc] init];
[item setDataProvider:self forTypes:[NSArray 
arrayWithObject:(NSString*)kPasteboardTypeFileURLPromise]];
[item setString:@net.mycompany.mydocument 
forType:kPasteboardTypeFilePromiseContent];
[pboard writeObjects:[NSArray arrayWithObject:item]];

But when I drag my objects, the delegate method 
pasteboard:item:provideDataForType: is never called. 
If I use public.data instead of my custom UTI, I get the following output in 
the console:

Looked for HFSPromises on the pasteboard, but found none

Sadly, the system documentation does not provide any more clues.

Cheers

Frank






___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Pasteboard file promises under 10.6

2010-01-04 Thread Nick Zitzmann

On Jan 4, 2010, at 11:06 AM, Frank Illenberger wrote:

 Does anybody know how to get file promises working with the new pasteboard 
 API in Snow Leopard?

You can't. Every version of Mac OS X to date treats file promise pasteboards as 
being different from all other kinds of pasteboards, and the only supported way 
of starting a file promise drag operation is by using the 
-dragPromisedFilesOfTypes:... method of NSView. Also, some built-in views 
support file promise dragging through their delegate or data source methods, 
which ultimately use -dragPromisedFilesOfTypes:... to do the drag.

Nick Zitzmann
http://www.chronosnet.com/

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com