• 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: OutlineView custom rows
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >OutlineView custom rows (From: Coleman Nitroy <email@hidden>)

  • Prev by Date: Re: (hopefully!) simple newbie question
  • Next by Date: Re: (hopefully!) simple newbie question
  • Previous by thread: OutlineView custom rows
  • Next by thread: Can we add different colors to groups of columns in non-custom TableView?
  • Index(es):
    • Date
    • Thread