Hi Nicolas,

there may be different ways to do it, I would put the radio buttons into
a block, and reference them through there index in the block.

Normally I would add the buttons directly after I created the word to
hold them, so what I#ll show here is, how to get them out of a layout
block.

;-- Rebol file starts --
[REBOL [
        Title: "Dynamically named radiobuttons"
        ]
        
radio-buttons: copy []

lay: [
        t7: text "Just an example"
        r1: radio of 'groupe1 text "INFO DYN1"
        r2: radio of 'groupe1 text "INFO DYN2"
        rn: radio of 'groupe1 text "INFO DYNn"
        button "Set second button" [
                ; the words are only defined _after_ layout, so I can't
                ; get the real buttons before the layout
                rb: get radio-buttons/2
                rb/state: true
                ; and why are changes not shown?
                show lay
        ]
]

parse lay [
        here: (probe here)
        some [
                to set-word! here: (probe here) [
                        copy wrd set-word! 'radio (
                                ; change set-word! to word!
                                ; why is wrd a block?
                                wrd: to word! wrd/1
                                ; apend the word to the list of
                                ; radiobuttons
                                append radio-buttons wrd
                        )
                        |
                        skip
                        |
                        to end
                ]
        ]
]


view layout lay
]
; -- rebol file ends --


I hope this will guide you on your way ...

Ingo


Am Sam, 2002-09-21 um 11.50 schrieb Nicolas Maillard:
> HI,
> 
> i'am trying to  explain beter =)
> 
> i generate a script in dyn the data inside are not the same each time the
> file is created. so in this file i generated radio buttons whitch are like
> that :
> r1: radio of 'groupe1 text "INFO DYN1"
> r1: radio of 'groupe1 text "INFO DYN2"
> rn : radio of 'groupe1 text "INFO DYNn"
> 
> a radion button for validate the choice.
> 
> So i can't use r1/data or r2/data or rn/data because i never know if he
> exists. How can i recover dynamicaly the choice of th radio buton?
> 
> for exemple if he choose the third choice can i use a thing like that :
> groupe1/data? or other thing
> 
> thx for all
> 
> 
> ----- Original Message -----
> From: "Graham Chiu" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, September 21, 2002 4:53 AM
> Subject: [REBOL] Re: radio button
> 
> 
> > >blk: copy []
> > >repeat i 2 [
> > >     repend blk [
> > >         'across
> > >         to-set-word join 'r i 'radio
> > >             'of to-lit-word 'groupe
> > >         'text join "my info" i
> > >         'below
> > >     ]
> > >]
> > >repend blk ['do [r2/data: true]]
> > >
> > >l: layout blk
> > >view l
> > >
> > >After layout has been called, the same paths can be
> > >called, like setting
> > >r2/data to false.  However, the displayed window must
> > >manually be told to
> > >update using show:
> >
> > Hi Scott,
> >
> > How do you access r1 .. rn dynamically?
> >
> > --
> > Graham Chiu
> > --
> > To unsubscribe from this list, please send an email to
> > [EMAIL PROTECTED] with "unsubscribe" in the
> > subject, without the quotes.
> >
> >
> 
> -- 
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the 
> subject, without the quotes.
> 
> 


-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to