[REBOL] Re: Accessing facets without using variables?
From: brett::codeconscious::com at: 9-Jun-2001 10:58
Hi Jose,
Here some example code.
;------------------------------
; Build a face using layout. The boxes will all be in a vertical line.
layout-spec: copy [style bx box 10x10]
num-boxes: 10
for i 1 num-boxes 1 [
append layout-spec compose [bx (multiply i divide 255.255.255 num-boxes)
user-data 'my-box]
]
; Show the main face - a vertical line of boxes.
view out: layout layout-spec
; Put the boxes into a diagonal
offset: 0x0
foreach face out/pane [
offset: offset + 10x0
if probe face/user-data = 'my-box [face/offset: face/offset + offset ]
]
; Fix up the size of the main face - so that the boxes can be seen.
last-box: last out/pane
out/size: add add last-box/offset last-box/size 20x20
; Show the modified main face - boxes are shown diagonally.
view out
;------------------------------
HTH,
Brett