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: Eric Gorr <email@hidden>
- Date: Fri, 19 Dec 2008 17:30:53 -0500
On Dec 19, 2008, at 5:20 PM, Corbin Dunn wrote:
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.
Unfortunately, this does not work as calling this function causes
heightOfRowByItem to be called. So, an endless loop is entered.
I just need to know the width so I base the height on the width.
_______________________________________________
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