On 13 Mar 2009, at 16:48, Corbin Dunn wrote:

Thank you!
corbin


Just to note, as should probably be expected, that monkeying with the cell's font within

- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex

also seems to produce uneven text coloration of highlighted text cells.
Workaround is as before:

[aCell setStringValue:[aCell stringValue]];

Added a note to the radar on this.

On Mar 13, 2009, at 7:08 AM, jonat...@mugginsoft.com wrote:


On 12 Mar 2009, at 17:07, Corbin Dunn wrote:


On Mar 12, 2009, at 3:51 AM, jonat...@mugginsoft.com wrote:

The recommended way to override the text color in an NSTableView NSTextFieldCell is detailed here:
http://www.cocoabuilder.com/archive/message/cocoa/2008/11/5/222008.

However, there seems to be a problem setting the text color of a highlighted NSTextFieldCell when NSTableView - selectionHighlightStyle is set to NSTableViewSelectionHighlightStyleSourceList.

The following delegate method produces uneven text coloration of highlighted text cells.

The issue does not arise for non source list style NSTableViews.

/*

tableview will display cell

*/
- (void)tableView:(NSTableView *)aTableView willDisplayCell: (id)aCell forTableColumn:(NSTableColumn *)aTableColumn row: (NSInteger)rowIndex
{
// note that when the NSTableView Highlight mode is set to source list
        // setting the text color of NSTextFieldCell seems to misbehave.
        if ([aCell isKindOfClass:[NSTextFieldCell class]]) {
                if ([aCell isHighlighted]) {
                        [aCell setTextColor: [NSColor lightGrayColor]];
                } else {
                        [aCell setTextColor: [NSColor darkGrayColor]];
                }
        }
}

Has anyone else encountered this?

Work around solution is probably to use NSAttributedString.

That is the only solution at the time. Could you log a bug for this?

Bug logged.
Bug ID: 6679161

NSTableView attempts to apply "standard attributes" for the highlighted cell, if plain text is given to the cell via the datasource.

corbin



Jonathan Mitchell

Central Conscious Unit
http://www.mugginsoft.com




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to