• 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: Multiple pasteboard items
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Multiple pasteboard items
      • From: David Catmull <email@hidden>
References: 
 >Multiple pasteboard items (From: David Catmull <email@hidden>)
 >Re: Multiple pasteboard items (From: Bryan Prusha <email@hidden>)
 >Re: Multiple pasteboard items (From: David Catmull <email@hidden>)

  • Prev by Date: Re: NSBrowser focus question
  • Next by Date: [Spotlight API] Will file names be indexed ever?
  • Previous by thread: Re: Multiple pasteboard items
  • Next by thread: Re: Multiple pasteboard items
  • Index(es):
    • Date
    • Thread