Re: Determining width of a cell in an NSOutlineView
Re: Determining width of a cell in an NSOutlineView
- Subject: Re: Determining width of a cell in an NSOutlineView
- From: Corbin Dunn <email@hidden>
- Date: Fri, 19 Dec 2008 14:20:15 -0800
On Dec 19, 2008, at 1:35 PM, Eric Gorr wrote:
I only have a single column in my NSOutlineView.
The outline view looks like:
> Collapsible Row 1
Item 1
> Collapsible Row 2
Item 2
I need the height of a row an of an item displayed when the
disclosure triangle is clicked to be based on the width of the cell.
I can get the indentation level by doing:
NSInteger level = [outlineView levelForItem:item];
and the amount that is indented per level by doing:
CGFloat indentation = [outlineView indentationPerLevel];
Asking for the width of the column does not return the same width of
the bounds parameter when drawInteriorWithFrame is called for my cell.
What looks like could work is to get the frame of the NSOutlineView
and then subtract the width of the frame by:
indentation * (level + 1)
but this doesn't seem like it should be the right answer.
There doesn't seem to be a method I can call to obtain the bounds
that will be passed into drawInteriorWithFrame for my cell. Have I
missed something?
-frameOfCellAtColumn:row: is exactly what will be passed to your cell.
corbin
_______________________________________________
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