FROM : Sebastian Morsch
DATE : Sat Jan 05 15:24:33 2008
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
DATE : Sat Jan 05 15:24:33 2008
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
| Related mails | Author | Date |
|---|---|---|
| Sebastian Morsch | Jan 5, 15:24 | |
| Ken Ferry | Jan 5, 19:29 | |
| Sebastian Morsch | Jan 6, 10:31 |






Cocoa mail archive

