• 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: Table with cells as dragging destination?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Table with cells as dragging destination?


  • Subject: Re: Table with cells as dragging destination?
  • From: Graham Cox <email@hidden>
  • Date: Mon, 12 Apr 2010 09:52:19 +1000

On 09/04/2010, at 1:26 AM, Izak van Langevelde wrote:

> I implemented the table as an NSTableView with NSImageCells, I know about the standard drag and drop for table rows.
> However, I am clueless about how to use cells as dragging destination.
> Am I supposed to subclass NSTableView, and implement drag and drop, including all gory details? Are there any examples available?
> Is there another view more suitable for what I'm trying to achieve?


You should be able to do it all with delegate/dataSource methods.

You are not dragging data to the table view's cells. You are dragging data to the underlying data model, which the table view displays (the table view only has one cell per column anyway).

When you receive the drag, handled by the datasource dragging callbacks, just insert the new image data into your data model and ask the table to redisplay. Simple as.

--Graham


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

References: 
 >Table with cells as dragging destination? (From: Izak van Langevelde <email@hidden>)

  • Prev by Date: Re: NSInvocation error when closing a dirty document
  • Next by Date: Re: Problem with reading an NSPipe->NSFileHandle to end
  • Previous by thread: Table with cells as dragging destination?
  • Next by thread: Drag and drop (NSCollectionView)?
  • Index(es):
    • Date
    • Thread