• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSFilePromisePboardType
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSFilePromisePboardType


  • Subject: Re: NSFilePromisePboardType
  • From: Peter Maurer <email@hidden>
  • Date: Fri, 17 Dec 2004 08:35:13 +0100

...
// FINALLY!!
// Okay HFS File promises work through a bit of black magic,
// I have h4x0red into it without revealing too much of it's workings here
// I should edit this later to maintain whatever other info was on the pboard
if ( [[pboard types] containsObject:NSFilesPromisePboardType] ) {
NSArray *promisedTypes = [[pboard
propertyListForType:NSFilesPromisePboardType] retain];;

NSFilePromiseDragSource *aFSource = [[[NSFilePromiseDragSource
alloc] initWithSource:sourceObject] autorelease];
[pboard declareTypes:[NSArray
arrayWithObjects:NSFilesPromisePboardType, @"CorePasteboardFlavorType
0x70686673", @"CorePasteboardFlavorType 0x66737350",
@"NSPromiseContentsPboardType", nil] owner:aFSource];


// Construct the HFS Flavor for the Finder to use on Drop
PromiseHFSFlavor aFlavor;
memset( &aFlavor, 0, sizeof(aFlavor) );
if ( [promisedTypes containsObject:@"'fold'"] ) aFlavor.fileType = 'fold';
aFlavor.fileCreator = '????';
aFlavor.promisedFlavor = 'fssP';
NSData *flavorData = [NSData dataWithBytes:&aFlavor length:14];
[pboard setPropertyList:promisedTypes forType:NSFilesPromisePboardType];
[pboard setData:flavorData forType:@"CorePasteboardFlavorType 0x70686673"];


		// Cleanup
		[promisedTypes release];
	}

Why don't you simply use [NSOutlineView dragPromisedFilesOfTypes: ...] and override your outline view's -dragImage:at:offset:event:pasteboard:source:slideBack: method to add any additional pasteboard type you might want to use?


<http://developer.apple.com/documentation/Cocoa/Conceptual/DragandDrop/ Tasks/faq.html#//apple_ref/doc/uid/20002248/BBCFIJGF>

Works fine for me, and it's a somewhat more "official" way of doing this ;-)

Peter.

_______________________________________________
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


  • Follow-Ups:
    • Re: NSFilePromisePboardType
      • From: The Karl Adam <email@hidden>
References: 
 >NSFilePromisePboardType (From: Fredrik Olsson <email@hidden>)
 >Re: NSFilePromisePboardType (From: Nick Zitzmann <email@hidden>)
 >Re: NSFilePromisePboardType (From: The Karl Adam <email@hidden>)
 >Re: NSFilePromisePboardType (From: The Karl Adam <email@hidden>)

  • Prev by Date: Re: has exited due to signal 10 (SIGBUS).
  • Next by Date: Re: NSFilePromisePboardType
  • Previous by thread: Re: NSFilePromisePboardType
  • Next by thread: Re: NSFilePromisePboardType
  • Index(es):
    • Date
    • Thread