Alternate row colors and selection
Alternate row colors and selection
- Subject: Alternate row colors and selection
- From: Ivan C Myrvold <email@hidden>
- Date: Tue, 25 Mar 2008 08:34:16 +0100
I have an NSOutlineView, where the cells in one of the columns are
NSButtonCell.
In the delegate method
outlineView:willDisplayCell:forTableColumn:item:, I am setting the
alternate colors with
if ([te isColored]) // even row number
[aCell setBackgroundColor:evenColor];
else
[aCell setBackgroundColor:[NSColor whiteColor]];
This works fine for the columns which have NSTextFieldCell, and it
also colors the column with the NSButtonCell,
but when I select a row, the column with NSButtonCell still have the
color as set above, and not the selection color.
This looks weird, as all the other columns have the selection color,
and there is a gap for this column.
How do I fix this? If I set the "Alternating Rows" in IB, the
selection color is fine for all the columns, but I can't use that as I
have some special requirements of the coloring.
Ivan
_______________________________________________
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