[REBOL] Re: binding object content to layout items ...
From: gjones05:mail:orion at: 24-May-2001 10:05
From: "Petr Krenzelok"
> Is there also any easy way of how to auto-layout object to window?
GSJ> > I am sorry, Petr, I am not sure what you mean by this. Can you
GSJ> > it in different words?
> Well, I had it almost done one day during some earlier beta View
> mean - you take object (pairs of word-name + word-value) and will
> layout in such way, that word-name will serve you as description for
> and word-value will be put into field ...
> obj: context [
> Name: "Petr Krenzelok"
> Email: [petr--krenzelok--trz--cz]
> should result in:
> lo: layout [
> text "Name:" name: field obj/name
> text "Email:" email: field obj/email
> ... or something like that ..
Hi, again, Petr,
Here is a very generic layout method. It generates labels, fields and
data from a data object:
obj: context [
Name: "Petr Krenzelok"
Email: to-string [petr--krenzelok--trz--cz]
lo-data: copy 
for idx 2 length? first obj 1 [
fn: pick first obj idx
fv: pick second obj idx
append lo-data reduce [
'text rejoin [fn ":"]
to-set-word fn 'field fv
view layout lo-data
Hope this is close to what you are looking for, or at least adaptable.