• 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: Quick (?) NSCell question: getting the drawing (inner) rectangle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quick (?) NSCell question: getting the drawing (inner) rectangle


  • Subject: Re: Quick (?) NSCell question: getting the drawing (inner) rectangle
  • From: Luke Evans <email@hidden>
  • Date: Thu, 15 Jan 2009 00:59:57 -0800

Mmm... well it looks like NSTableColumn's -width might is returning the same size that I actually get asked to draw in my NSCell subclass, so perhaps this is indeed simple/quick.

I was concerned that intercell spacing, grid etc. might have to come out of the column width before the cell width residual is known - but if the column width is always the same as the drawable cell width then that's great.


On 14-Jan-09, at 10:07 PM, Luke Evans wrote:

I'm trying to determine what a cell's drawing rect will be (particularly the 'interior' size eventually expected to be sent to - drawInteriorWithFrame:inView: when the cell is actually drawn).
I can get the 'prototypical' cell object by asking for the pertinent NSTableView column, and then asking for the cell. I can see that NSCell supports a range of methods under the heading "Determining Cell Size" in the docs.
The method -drawingRectForBounds: looks promising, but it takes another rectangle, i.e. the "bounds". Assuming that this method would give me what I want, how do I first obtain the appropriate 'bounds' to feed it?


Perhaps this method is only intended to provide information to the system by the NSCell implementation and is not intended for the purpose I need. In which case, is there a way to achieve what I want without having to ask for the NSTableColumn width and working out what proportion of this width is used for non-'interior' furniture (if any)?

Cheers

-- Luke




_______________________________________________

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: 
 >Quick (?) NSCell question: getting the drawing (inner) rectangle (From: Luke Evans <email@hidden>)

  • Prev by Date: Re: NSImage resizing
  • Next by Date: Re: File association
  • Previous by thread: Quick (?) NSCell question: getting the drawing (inner) rectangle
  • Next by thread: Re: Quick (?) NSCell question: getting the drawing (inner) rectangle
  • Index(es):
    • Date
    • Thread