[REBOL] Re: Menu in REBOL-View
From: cyphre:seznam:cz at: 26-Oct-2004 20:13
Mike,
Regarding the [data (false)] case you mentioned. I decided to write a bit
more about this "hidden feature".
I forgot to mention that the DATA block of the my-list style is using some
kind of data-dialect.
If you specify cell content without brackets [] it will handle it as a text
content for given cell element(VID style you are using in the columns
block). Example:
...........
data [[1 "hello" word]]
..........
In this case the list engine fill all three cels in a row with texts "1"
hello
"world".
That is enough for suplying cells of style TEXT, FIELD, BUTTON etc. But when
you need to specify other data for given cell you need to use [] brackets
which means for the engine "turn the dialect on" and supply all the stuf in
the block to the style of the cell. Example:
.............
data [[[data #[false]] [effect [gradient 1x1 red green]][image logo.gif]]]
............
In this case the list engine sets appropriate properties in specific cells.
This way you are able to do lot of things, not only the text lists etc.
basically you have a grid engine which can be easily programmed.
You can also acces those data dialect blocks at runtime and modify them
using face/user-data reference. for example:
.......
data [[[data #[false]]]]
columns [
check 24x24 [face/user-data/2: face/data]
]
......
In this case when user clicks on the checkbox the code in action block of
the cell will dynamically rewrite the logical value in data dialect block so
the new checkbox state is remembered when the list is refreshed.
The idea of list(or grid) data dialecting is still in alpha stage(and I have
still lot ideas to improve it) so feel free to made any comments.
regards,
Cyphre