• 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: Drawing the background of a single row in NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Drawing the background of a single row in NSTableView (From: Peter Zegelin <email@hidden>)
 >Re: Drawing the background of a single row in NSTableView (From: Dado Colussi <email@hidden>)
 >Re: Drawing the background of a single row in NSTableView (From: Peter Zegelin <email@hidden>)

  • Prev by Date: Re: Dynamically loading a part of a Window in Cocoa
  • Next by Date: Re: NSTableView bug?
  • Previous by thread: Re: Drawing the background of a single row in NSTableView
  • Next by thread: Re: Programmatically adding to one big Finder selection ?
  • Index(es):
    • Date
    • Thread