Re: Multiple pasteboard items
Re: Multiple pasteboard items
- Subject: Re: Multiple pasteboard items
- From: Bryan Prusha <email@hidden>
- Date: Thu, 14 Jul 2005 10:58:32 -0700
On Jul 14, 2005, at 10:41 AM, David Catmull wrote:
On Jul 14, 2005, at 10:17 AM, Bryan Prusha wrote:
The Carbon Pasteboard has built in support for multiple items. The
NSPasteboard approximates this feature in some cases with special
"multiple item" flavors like NSFilenamesPboardType and
NSFilesPromisePboardType.
Are there any other flavors like that?
I'm not sure. I just pulled those from NSPasteboard.h.
Is there no toll-free bridging between PasteboardRef and NSPasteboard?
No. A PasteboardRef is a CFType and both APIs use the same
underlying mechanism, but they are not toll-free bridged objects.
I want to be able to drag multiple images between my NSTableViews,
where each row represents an image. It sounds like I'd have to
somehow bypass the usual NSTableView drag and drop interface and
use the Carbon D&D API instead. That doesn't sound fun.
You aren't required to use the Carbon Drag & Drop API. Continue
using the NSDragging protocol, but when handed the NSPasteboard, ask
for its name. From that you can create a Carbon Pasteboard by name (w/
o clearing) and access to the same data (kind of like toll-free
bridging I guess, you just can't mix and match methods). At that
point, there's nothing keeping your Cocoa application from making use
of the Carbon Pasteboard. It is a standalone API. Use either API as
suits your needs. If there are pieces that you would like to see
added to either side I would suggest writing enhancement requests.
I suppose an alternative is to combine all the images into one
chunk of data, and then separate them out again when dropping. I'd
rather not resort to a custom data format, though.
One of the Cocoa engineers might have more ideas on the subject.
A multiple image flavor may exist. Do you have files backing these
images or are they resident in memory only? When dragging images in
iPhoto for instance only the file URLs are added to the drag, not the
image data.
_______________________________________________
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