Colorizing List Fields
Sarah Reichelt
sarah.reichelt at gmail.com
Thu Jun 21 21:15:20 EDT 2007
> > Is it possible to use either htmlText or rtfText to color the lines
> > of a list? I have a list field where I'd like to have each line
> > colored depending on the type of record it's displaying. If I can't
> > set the font or background color using htmlText, what exactly CAN I
> > use htmlText for?
>
> You can set either or both... and you don't need to use htmlText or
> rtfText if you don't want to - you can set the 'textColor' or
> 'backgroundColor' property of individual lines from script:
>
> set the textColor of line 2 of field "MyListField" to red
>
> But if you'd rather use HTML or RTF, be my guest:
>
> put "<font color=" & quote & "red" & quote & "> & \
> line 2 of field "MyListField" & "</font>" into tHTML
> set the htmlText of line 2 of field "MyListField" to tHTML
While either of these approaches will work, the html version is much
faster if you have to color a lot of lines because you can work in a
variable instead of directly in a field.
I have a printout generation routine where every 2nd line changes
color and there are about 6000 lines. Using "set the textColor" took
several minutes, but building the html to change colors happens almost
instantly.
Cheers,
Sarah
More information about the use-livecode
mailing list