joels
joels

Reputation: 7731

Nstableview group style for nsoutlineview

I like the look of the group rows in the nstableview. In apple mail, the group sections like mailboxes and rss with that style too.

Is there an easy way to make a group row or root item in an nsoutlineview to look like that? I think I have to override the willDisplayCell method...

Upvotes: 1

Views: 2822

Answers (1)

Peter Hosey
Peter Hosey

Reputation: 96353

Is there an easy way to make a group row or root item in an nsoutlineview to look like that?

I'm not sure why Rob Keniger deleted his answer; it's almost perfectly accurate. I repost it here with one clarifying change:

You need to implement the -outlineView:isGroupItem: delegate method [in your outline view's delegate] and return YES for items that are group items.

(He said “delegate method of NSOutlineView”, which I think was simply him accidentally writing something different than what he was thinking.)

If he undeletes it, you should give him the credit for it.

Upvotes: 1

Related Questions