Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Picky Pasteboard Flavors?



I am trying to put a flavor onto the pasteboard. Everything works fine if one of the flavors includes a known public type, but otherwise, my private and dynamically generated pasteboard flavors alone are not enough to actually change the pasteboard.

The sample code below fails to change the pasteboard unless I include the second PasteboardPutItemFlavor(... thePublicFlavorName,...). I have removed the error checking, but no errors were returned.

In my app I am trying to create a WebURLsWithTitlesPboardType flavor on the pasteboard. I use UTTypeCreatePreferredIdentifierForTag() to get a dynamic identifier that does match the one I get from other apps. However, the pasteboard does not change with only the single flavor. What flavor should my Carbon app be using to provide a list of URLs with titles?

Thanks,
Jack

void ClipboardPasteMyData( UInt8* inTheString );
void ClipboardPasteMyData( UInt8* inTheString )
{

PasteboardRef thePBoard;
OSStatus result;
PasteboardItemID theItemID = (PasteboardItemID)1;
CFStringRef thePrivateFlavorName = CFSTR ( "private.my.personal.flavor" );
CFStringRef thePublicFlavorName = CFSTR( "public.utf8-plain-text" );


CFDataRef thePData = CFDataCreate( kCFAllocatorDefault, inTheString, strlen((char*)inTheString) );

result = PasteboardCreate( kPasteboardClipboard, &thePBoard );
result = PasteboardClear( thePBoard );
result = PasteboardSynchronize( thePBoard );

result = PasteboardPutItemFlavor( thePBoard, theItemID, thePrivateFlavorName, thePData, 0 );
// result = PasteboardPutItemFlavor( thePBoard, theItemID, thePublicFlavorName, thePData, 0 );

CFRelease( thePData );
}



_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.