Forum breadcrumbs - You are here:WeLoveGod RallysPublic Forums: fbcocoaTableView: changing text color in …
You need to log in to create posts and topics.
TableView: changing text color in a specific cell ( i.e. specific row/column )
1,678 Posts
#1 · September 22, 2012, 8:49 pm
Quote from Forum Archives on September 22, 2012, 8:49 pmPosted by: fblistserve <fblistserve@...>
On Sep 22, 2012, at 5:21 PM, Brian S <fblistserve@cox.net> wrote:
My initial research indicates:
(void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCellforTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndexMy initial pass at this delegate method proves it accomplishes the objective of coloring text ( code needs refinement ----a test only ).- (void) tableView:(NSTableView *)aTableViewwillDisplayCell:(id)aCellforTableColumn:(NSTableColumn *)aTableColumnrow:(NSInteger)rowIndex{if ( aTableView == tableViewTab2 ){id keyName = [aTableColumn identifier];if ( [keyName isEqualToString:ColNextDateIdTab2] && (rowIndex == 0 ) ) // color next date column for row 0 only.{[aCell setTextColor: [NSColor redColor]];}else{[aCell setTextColor: [NSColor blackColor]];}}}Brian S.
To unsubscribe, e-mail: fbcocoa-unsubscribe@welovegod.org For additional commands, e-mail: fbcocoa-help@freegroups.net
Posted by: fblistserve <fblistserve@...>
On Sep 22, 2012, at 5:21 PM, Brian S <fblistserve@cox.net> wrote:
My initial research indicates:
(void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCellforTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex
My initial pass at this delegate method proves it accomplishes the objective of coloring text ( code needs refinement ----a test only ).
- (void) tableView:(NSTableView *)aTableView
willDisplayCell:(id)aCell
forTableColumn:(NSTableColumn *)aTableColumn
row:(NSInteger)rowIndex
{
if ( aTableView == tableViewTab2 )
{
id keyName = [aTableColumn identifier];
if ( [keyName isEqualToString:ColNextDateIdTab2] && (rowIndex == 0 ) ) // color next date column for row 0 only.
{
[aCell setTextColor: [NSColor redColor]];
}
else
{
[aCell setTextColor: [NSColor blackColor]];
}
}
}
Brian S.
To unsubscribe, e-mail: fbcocoa-unsubscribe@welovegod.org For additional commands, e-mail: fbcocoa-help@freegroups.net
Click for thumbs down.0Click for thumbs up.0