Understanding LIST better
[1/3] from: DNess::comcast::net at: 28-Jul-2003 14:13
I have some code that uses `list[...]data[...]' to display some data.
Very occasionally I would like to `color' one of the data items in some
way (note: I mean color a single data item, not a column of data), and
am wondering if this is possible. The program that generates
the data[...] values _is_ under my control so I can cause it to be marked up
in any way that is necessary. An example might be to produce
1.1 2.2 3.3
4.4 -5.5 6.6
7.7 8.8 9.9
where the -5.5 is colored red and all the rest are black...
If there is some place that I can read more about layout list
I'd appreciate a pointer...
[2/3] from: antonr:iinet:au at: 29-Jul-2003 10:26
Hello David,
my-list: list gray list-size list-layout-blk data list-data supply [
; count is the row number
; index is the face number
row: pick head l-block count
but/text: all [row pick row 1]
fld/text: all [row pick row 2]
]
(index is also like the column, assuming your list layout goes across.)
The code above is from this example:
http://www.lexicon.net/anton/rebol/gui/demo-vid-list-scroller.r
You can see that the text is not the only facet you can change.
You could also do:
value: all [row pick row 1]
but/font/color: any [all [negative? value red] black]
and/or set the background color with:
but/color: all [negative? value maroon] ; (none is transparent)
Anton.
[3/3] from: DNess:comcast at: 29-Jul-2003 8:24
Your example is highly instructive. It will take me a while to study
it, and it will probably provoke some further questions, but in the
meantime thank you for taking the trouble to point out this
very useful example.
7/28/2003 8:26:22 PM, Anton <[antonr--iinet--net--au]> wrote: