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: Thu, 04 Apr 2002 22:20:12 -0500
Hi,
Sorry to burst your bubble, but I want to color the text in a row, not a
column.
Seems there's really no elegant way to do this.
On 4/4/02 9:49pm, "email@hidden"
<email@hidden> wrote:
>
From: Matt Massicotte <email@hidden>
>
Date: Thu, 4 Apr 2002 21:46:24 -0500
>
To: email@hidden
>
Cc: email@hidden
>
Subject: Re: Color entire table view row
>
>
Finally!
>
>
A question that *I* actually know the answer to! I'm happy to report
>
that I have implemented this myself quite effectively. I'm sure that
>
it's not the best way to do it, so maybe some of the more experienced
>
guys can give us both a hand :)
>
>
What I did was subclass NSTableColumn and change the columns in IB to my
>
subclass. The actual subclass simply keeps an array of cells (instead
>
of one single data cell) and overrides the methods that interact with
>
the data cell.
>
>
In order to ensure that my column has the right number of cells, I
>
adjust the number of cells every time my datasource's
>
numberOfRowsInTableView method is called.
>
>
Now, you can set the text color of the cells to your heart's content.
>
>
This works rather well for me (although I have noticed that if you have
>
multiple columns, and you only change one to your subclass, other rows
>
get colorized and I'm not sure why)
>
>
So, I hope this points you in the right direction
>
Matt Massicotte
>
--
Kindest regards,
Erik J. Barzeski
"Programming is an art form that fights back." - Anonymous
*******************************************************************
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.