Re: Cannot D&D from an NSTableView
Re: Cannot D&D from an NSTableView
- Subject: Re: Cannot D&D from an NSTableView
- From: Koen van der Drift <email@hidden>
- Date: Mon, 14 Nov 2011 20:53:52 -0500
Good info, thanks.
I also noticed that now with using NSTextFieldCell, I get a tooltip for each cell. Which I can use :)
- Koen.
On Nov 14, 2011, at 8:21 PM, Conrad Shultz wrote:
> Ah...
>
> Have you read the documentation for NSCell's -hitTestForEvent:inRect:ofView: ?
>
> In particular the note:
>
> If the cell not disabled, and it would track, return NSCellHitContentArea |NSCellHitTrackableArea.
>
> I believe that for dragging to work you do NOT want to return NSCellHitTrackableArea. What happens in your custom cell class if you return just NSCellHitContentArea?
>
> (I'm assuming from your original message that you had been using the default hit test implementation.)
>
> (Sent from my iPhone.)
>
> --
> Conrad Shultz
>
> On Nov 14, 2011, at 17:05, Koen van der Drift <email@hidden> wrote:
>
>>
>> On Nov 14, 2011, at 7:15 PM, Conrad Shultz wrote:
>>
>>> Are you subclassing NSCell directly or using one of its subclasses?
>>>
>>> Out of the box, NSTableView (or, rather, NSTableColumn) uses an
>>> NSTextFieldCell, which importantly inherits from NSActionCell, which
>>> itself adds lots of core functionality that we are used to (for example,
>>> the target-action pattern).
>>>
>>> It's possible that it also does some things behind the scenes to make
>>> drag and drop work better. So: what happens if you inherit from
>>> NSActionCell?
>>
>> I'm indeed subclassing NSCell. Using NSActionCell doesn't make a difference. But with NSTextFieldCell it works.
>>
>> Thanks for the suggestion.
>>
>> - Koen.
_______________________________________________
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