Re: OutlineView custom rows
Re: OutlineView custom rows
- Subject: Re: OutlineView custom rows
- From: "Timothy J. Wood" <email@hidden>
- Date: Wed, 11 Jan 2006 08:27:18 -0800
On Jan 11, 2006, at 12:57 AM, Coleman Nitroy wrote:
I have been trying to create special rows or "subheadings" in an
OutlineView, but to no avail.
This is a mock-up of what I am trying to achieve (http://
cole.nitroy.com/Files/Temp/outlineViewWishList.png)
If I subclass the NSTableColumn, and return a subclass of a NSCell
the inner part gets draw in, but not the entire row. I want to
cover the entire row, expandable triangle and all. I have been
digging all over the net and trying to subclass various parts of
the NSOutlineView interface, but nothing seems to work. Does anyone
have any advice or suggestions for this?
OmniOutliner does this by subclassing NSOutlineView for its style
summary inspector, using something like the following:
@interface OSStyleInspectorOutlineView : NSOutlineView
{
OSStyleInspectorHeadingCell *_headingCell;
}
@end
@implementation OSStyleInspectorOutlineView
- (void)awakeFromNib;
{
...
_headingCell = [[OSStyleInspectorHeadingCell alloc]
initTextCell:@""];
...
}
- (void)drawRow:(int)row clipRect:(NSRect)clipRect;
{
if ([self levelForRow:row] == 0) {
[_headingCell setObjectValue:[(OSStyleInspectorItem *)[self
itemAtRow:row] name]];
[_headingCell drawWithFrame:[self rectOfRow:row] inView:self];
return;
}
[super drawRow:row clipRect:clipRect];
}
@end
Hopefully that'll do the trick for you.
-tim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden