Re: Color entire table view row
Re: Color entire table view row
- Subject: Re: Color entire table view row
- From: "Erik J. Barzeski" <email@hidden>
- Date: Fri, 05 Apr 2002 08:37:27 -0500
David,
On 4/5/02 2:33am, "David Remahl" <email@hidden> wrote:
>
Before I read your original post:
>
@interface NSCell(NSCellAttributedStringMethods)
>
- (NSAttributedString *)attributedStringValue;
>
- (void)setAttributedStringValue:(NSAttributedString *)obj;
Snip
Well... That doesn't really cut it. I don't care about attributed strings
and it still doesn't let me set the color value of text for the entire row.
I have one object in the data source that corresponds to a column in the
table and it IS an attributed string and it IS colored.
The whole point was to easily take that color and color the rest of the ROW
that it's in, so then I could have a green row (the text, not the bgcolor,
yuck), a red row, a grey row, a green row, another green row, a black row...
Etc.
In short, given the responses, it seems my original hypothesis that there's
no elegant way to do this is in fact true (at least to the extent of
"elegant").
Something like this as a table view delegate would be awfully nice:
- (NSDictionary *)displayAttributesForRow:(int)row
But oh well. :P
>
After I read your initial post:
>
>
Your task seems better fit for a formatter, don't you think? You will have
>
to implement the formatter calling yourself from your datasource still, and
>
still set the attributed string, but the final solution will be a bit more
>
portable and encapsulated in a familiar interface.
Still too much work and still not elegant. This is one of those features
where "I'd implement it in my app if it exists, but it's not worth the time
or effort to write my own (and then be forced to maintain it)." I'm just
surprised that there's no method like the one I listed above.
--
Best wishes,
Erik J. Barzeski
"My girlfriend always laughs during sex -
no matter what she's reading." - Steve Jobs
*******************************************************************
Email: erik@(anything below)
AIM: iacas ICQ: 8186546
http://barzeski.com/ http://weims.net/
http://techstra.net/ http://cocoadevcentral.com/
http://soundsetcentral.com/ http://applescriptcentral.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.