[REBOL] Re: radio button
From: gscottjones:mchsi at: 20-Sep-2002 15:40
From: "Nicolas Maillard"
> I'am working on a dynamic code generation
> in rebol. and i have a pb. I create dynamicaly
> "n" radio buttons which are all attached in a
> same group "group1":
>
> r1: radio of 'groupe1 text "my info"
> r2: radio of 'groupe1 text "my info2"
> etc ..
>
> r1, r2, r3 ... are generated and change each time the file is created.
>
> How can i do dynamicaly the thing i can't do like : r1/data r2/data. Does
groupe1/data work?
> Plz help me =)
Hi, Nicolas,
I am not sure that I understand your question. The reason that I am not
sure that I understand, is because you should be able to use r1/data, etc.
Here is an example of a dynamically laid out display. Just before layout
out is called, a line is added that sets r2 to true, which means that it
will be selected on start up:
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:
view layout [
r1: radio of 'groupe1 text "my info"
r2: radio of 'groupe1 text "my info2"
button "Change R2" [
r2/data: not r2/data
show r2
]
]
Hopefully by rambling I have answered your question.
:-)
--Scott Jones