1
votes

When an NSTableView has the style NSTableViewSelectionHighlightStyleRegular, the group rows have a very nice background and design overall. I'd like a NSTableViewSelectionHighlightStyleSourceList Table view, but with the same header style.

Has anyone an idea how to do this, without having to subclass it?

1
Are you using a 10.7 view-based NSTableView or a regular cell-based one? With the view-based, NSTableRowView is responsible for drawing the selection highlight.bijan
Yes, I'm using a 10.7 view based table viewIluTov

1 Answers

0
votes

I guess there is no other way then subclassing it, but it's pretty easy: Just make a subclass of NSTableRowView, override the DrawRect method. Check the property self.isGroupRowStyle. If it is, then write the code to draw it. Else just call [super drawRect:dirtyRect];

In the TableView Delegate, return an instance in the tableView:rowViewForRow: Method.

thanks anyway