Re: Using NSCell to bold cells in a tableview
Re: Using NSCell to bold cells in a tableview
- Subject: Re: Using NSCell to bold cells in a tableview
- From: Jan Van Boghout <email@hidden>
- Date: Sat, 28 Dec 2002 12:02:15 +0100
It's easier to use the following delegate method:
- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell
forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex
Then you can determine which cells to be bold and not bold with
something like this (with cellCanBeBold a boolean that represents
whether your item at row rowIndex and column aTableColumn should be
bold)
if (cellCanBeBold)
[aCell setFont:[NSFont boldSystemFontOfSize:12]];
else
[aCell setFont:[NSFont systemFontOfSize:12]];
Something like this :)
>
I am trying to bold just certain rows in my NSTableView. So I have
>
done the
>
following code (tableDateTime is the NSTableColumn, browserTableView
>
is the
>
NSTableView):
>
>
NSCell *myCell = [tableDateTime dataCellForRow:([browserTableView
>
numberOfRows]+1)];
>
[myCell setFont:[NSFont boldSystemFontOfSize:12]];
>
>
However, it ends up bolding every row in my tableview. If anyone has
>
some
>
thoughts, please let me know.
>
>
Thanks,
>
Ben
>
>
_______________________________________________
>
MacOSX-dev mailing list
>
email@hidden
>
http://www.omnigroup.com/mailman/listinfo/macosx-dev
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.