Re: Drawing the background of a single row in NSTableView
Re: Drawing the background of a single row in NSTableView
- Subject: Re: Drawing the background of a single row in NSTableView
- From: Michael Ash <email@hidden>
- Date: Thu, 2 Jul 2009 11:41:27 -0400
On Wed, Jul 1, 2009 at 8:09 PM, Peter
Zegelin<email@hidden> wrote:
>
> On 01/07/2009, at 6:55 PM, Dado Colussi wrote:
>
>> Subclass NSTableView and implement your special drawing in -
>> (void)drawBackgroundInClipRect:(NSRect)clipRect.
>>
>> /Dado
>
> Problem with this is there is no obvious concordance ( that I can see)
> between a row and its rectangle.
Doesn't need to be obvious, because Apple figured it out for you
already. To go from a location to a row:
- (NSInteger)rowAtPoint:(NSPoint)point;
And to go from a row to a rectangle:
- (NSRect)rectOfRow:(NSInteger)row;
> Wouldn't scrolling affect all this?
No. Scrolling is accomplished by applying a transform to the table's
superview. Coordinates within the scrolled view itself are not
affected at all.
Mike
_______________________________________________
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