Re: NSTableView drag image - using the first column image
Re: NSTableView drag image - using the first column image
- Subject: Re: NSTableView drag image - using the first column image
- From: Marek Hrušovský <email@hidden>
- Date: Mon, 18 Dec 2017 16:03:13 +0100
Override:
- (NSArray *)draggingImageComponents;
Apple uses it in its sample TableViewPlaygroud. I found it using br -n
"-[NSDraggingImageComponent initWithKey:]". lldb and breakpoints can help
you. Use hopper or class-dump to see method names (AppKit).
Marek.
On Fri, Dec 15, 2017 at 6:52 PM, David Catmull <email@hidden>
wrote:
> In my table view, when you drag an item, the drag image it uses comes from
> the column cell where the drag started, rather than using the cell from the
> first column where I have the icon and name. How do I make it use the first
> column?
>
> I'm looking at Apple's TableViewPlayground as an example, and the outline
> view there works like I want, and I can't see what the key difference is.
>
> I'm tempted to try to fix it in tableView:updateDraggingItemsForDrag: but
> the Apple sample only uses that to update the image for external drags. For
> local drags, that method is essentially not used. If I comment that method
> out, the first-column-image behavior I want still works in the sample.
>
> I have a simple example at https://github.com/Uncommon/TableTest - notice
> that dragging from different columns yields different drag images even
> though the data in the drag is the same.
> _______________________________________________
>
> 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
>
_______________________________________________
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