NSButtonCell in NSTableView doesn't receive setHighlighted:
NSButtonCell in NSTableView doesn't receive setHighlighted:
- Subject: NSButtonCell in NSTableView doesn't receive setHighlighted:
- From: Sebastian Morsch <email@hidden>
- Date: Sat, 5 Jan 2008 15:24:33 +0100
Hi,
I just found out that an NSButtonCell that sits in an NSTableView
doesn't receive the setHighlighted: message from the table when it's
displayed for a selected row. In the case of NSImageCell and
NSTextFieldCell it DOES happen, they both receive that message from
the table's preparedCellAtColumn:row: method.
I couldn't find an answer to this in previous posts.
I worked around this by subclassing NSTableView and overriding that
method to make sure all cells get the setHighlighted:
- (NSCell *)preparedCellAtColumn:(NSInteger)column row:(NSInteger)row
{
NSCell* cell = [super preparedCellAtColumn:column row:row];
[cell setHighlighted:(row == [self selectedRow])];
return cell;
}
It's not a big deal of course, but since setHighlight: is a superclass
method from NSCell it seems strange to me that the table doesn't treat
all cells equally. Is this expected behaviour or is it worth filing a
bug?
Sebastian
_______________________________________________
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