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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to