[ALLY] Re: object to layout?
From: ingo:2b1 at: 1-May-2001 6:36
Thanks Larry,
we were nearly there, the following is what I wanted (this
way changes in the fields are reflected in the object) ...
>> data: make object! [ test1: "The first test" test2: "the next test" ]
>> lay: copy [across tabs 60]
== [across tabs 60]
>> foreach elem next first data [
[ append lay compose [text (to-string :elem) tab
[ (to-set-word :elem) field (to-path reduce ['data :elem]) return]
[ ]
== [across tabs 60 text "test1" tab test1: field data/test1 return text "test2" tab test2:
field data/test2 return]
>> view layout lay
thanks again ...
Once upon a time Larry Palmiter spoketh thus:
> Hi Ingo
>
> Fun question. Here's my cut.
>
> Third OBJECT turns the object back to a block of setword value pairs. Using
> your example:
>
> >> third a
> == [t1: "Text1" t2: "Text2"]
>
> Then it is easy to manipulate:
>
> >> b: copy []
> == []
>
> >> foreach [setword string] third a [
> append b compose [
> text (form :setword) (:setword) field (string) tab]]
>
> == [text "t1" t1: field "Text1" tab text "t2" t2: field "Text2" tab]
>
> This is close to what you want.
>
> Perhaps others see a more elegant solution.
> -Larry
>
> ----- Original Message -----
> From: "Ingo Hohmann" <[ingo--2b1--de]>
> To: <[ally-list--rebol--com]>
> Sent: Monday, April 30, 2001 2:23 PM
> Subject: [ALLY] object to layout?
>
> > Hi Rebols,
> >
> > has anyone an idea how best to create a layout from an object! ?
> >
> > assume I have:
> >
> > a: make object! [t1: "Text1" t2: "Text2"]
> >
> > I want to create a layout like this:
> >
> > [ text "t1" tab t1: field return text "t2" tab t2: field ]
> >
> > with the fields set to the respective strings from the object!
> >
> >
> > I am halfway there, but my solution seems much to complicated ...
> >
> > thanks in advance,
> >
> >
> > Ingo
>
> --
> To unsubscribe from this list, please send an email to
> [ally-request--rebol--com] with "unsubscribe" in the
> subject, without the quotes.
>
--
do http://www.2b1.de/
_ . _
ingo@)|_ /| _| _ <We ARE all ONE www._|_o _ _ ._ _
www./_|_) |o(_|(/_ We ARE all FREE> ingo@| |(_|o(_)| (_|
._| ._|