Re: Customizing the drop highlight on a NSTableView
Re: Customizing the drop highlight on a NSTableView
- Subject: Re: Customizing the drop highlight on a NSTableView
- From: Corbin Dunn <email@hidden>
- Date: Wed, 02 Mar 2011 14:44:14 -0800
On Mar 2, 2011, at 2:39 PM, John Terranova wrote:
>
> On Mar 2, 2011, at 1:58 PM, Corbin Dunn wrote:
>
>>
>> On Mar 2, 2011, at 1:54 PM, Quincey Morris wrote:
>>
>>> On Mar 2, 2011, at 13:04, Eric Gorr wrote:
>>>
>>>> I am using the 10.5 SDK, so don't have access to -setDraggingDestinationFeedbackStyle:
>>>>
>>>> What are my options for customizing the drop highlighting for a NSTableView?
>>>>
>>>> The highlighting I want is for it to draw the drop indicator between rows and to never highlight an entire row. If this is possible under the 10.5 SDK, I would be interested in being pointed to it.
>>>
>>> If you return 'NSTableViewDropAbove' from the 'tableView:validateDrop:proposedRow:proposedDropOperation:' on 10.5, I don't think it will ever highlight a row. Isn't that what you want?
>>>
>>
>> No...don't do that :). tableView:validateDrop:proposedRow:proposedDropOperation expects an NSDragOperation result (I had said a BOOL, so I was wrong too!). Return NSDragOperationNone if dropOperation==NSTableViewDropOn. It will call you again with NSTableViewDropAbove.
>
> Really? I never realized that. I always used setDropItem:dropChildIndex: (in an outline view, for example) to redirect the drop when I want only NSTableViewDropOn, or never want NSTableViewDropOn.
yeah, really :)
But, your above method works too.
>
> Can the docs be a little more clear on this point, or did I just miss it?
They could be more clear..please do log a bug.
NSTableView decides which to call first, "on" or "between", and if the first call was refused it calls back with the other option. I'm not sure why this has historically been done, since one can always retarget with setDropItem:...
corbin
_______________________________________________
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