FROM : Power Mac User
DATE : Tue Apr 19 22:00:01 2005
On Apr 19, 2005, at 12:00 PM, <email_removed> wrote:
> Hello out there,
>
> i have a NSTableView with three columns. Does someone know a
> possibility to mark a single cell for example red (or another fancy
> effect:-)) without erasing the text inside?
Greetings,
You could possible fill in the background by implementing –
tableView:willDisplayCell:forTableColumn:row: in the NSTableView's
delegate.
i.e.:
- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell
forTableColumn:(NSTableColumn *)aTableColumn row:(int)aRowIndex
{
if ( aRowIndex % 2 == 0 )
{
NSColor *bgColor = [NSColor colorWithCalibratedRed:0.5
green:0.5
blue:0.5
alpha:1.0];
[aCell setDrawsBackground:YES];
[aCell setBackgroundColor:bgColor];
}
}
Regards,
<email_removed>
MacOSX-dev mailing list
<email_removed>
http://www.omnigroup.com/mailman/listinfo/macosx-dev
DATE : Tue Apr 19 22:00:01 2005
On Apr 19, 2005, at 12:00 PM, <email_removed> wrote:
> Hello out there,
>
> i have a NSTableView with three columns. Does someone know a
> possibility to mark a single cell for example red (or another fancy
> effect:-)) without erasing the text inside?
Greetings,
You could possible fill in the background by implementing –
tableView:willDisplayCell:forTableColumn:row: in the NSTableView's
delegate.
i.e.:
- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell
forTableColumn:(NSTableColumn *)aTableColumn row:(int)aRowIndex
{
if ( aRowIndex % 2 == 0 )
{
NSColor *bgColor = [NSColor colorWithCalibratedRed:0.5
green:0.5
blue:0.5
alpha:1.0];
[aCell setDrawsBackground:YES];
[aCell setBackgroundColor:bgColor];
}
}
Regards,
<email_removed>
MacOSX-dev mailing list
<email_removed>
http://www.omnigroup.com/mailman/listinfo/macosx-dev
| Related mails | Author | Date |
|---|---|---|
| nutrition1 | Apr 19, 16:37 | |
| Stephane Sudre | Apr 19, 17:50 | |
| Power Mac User | Apr 19, 22:00 |






Cocoa mail archive

