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: matt neuburg <email@hidden>
- Date: Sat, 28 Dec 2002 09:20:40 -0800
On Fri, 27 Dec 2002 11:38:13 -0800, Ben Mackin <email@hidden> said:
>
>
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
Certainly, because dataCellForRow returns the very same cell (the entire column's single dataCell), regardless of the row, and the docs are quite clear on this. Therefore, *this* (i.e. dataCellForRow) is what you need to be overriding if you want to change this behavior, and the docs are clear about this too. In short, it's just a matter of RTFM for dataCellForRow. m.
matt neuburg, phd = email@hidden,
http://www.tidbits.com/matt
pantes anthropoi tou eidenai oregontai phusei
Subscribe to TidBITS! It's free and smart.
http://www.tidbits.com/
_______________________________________________
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.