Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: Dynamic Layout creation

From: carl:cybercraft at: 16-Mar-2002 11:53

On 16-Mar-02, [riusa--email--it] wrote:
> After some tests, I discovered I could create a block (dinamically, > at runtime) and use this to create a layout. For example: if I want > to create some radio buttons at runtime (I'm reading some records in > a database, and every record generates a radio button), I can create > a block and... > > myBlock: [backcolor gray across] > append myBlock [radio label "test"] > view layout myBlock > ================================== > the previous code functions. But how can I do to assign a different > variable to every radio-button (see the hypotetical result below): > var1: radio label "test 1" return > var2: radio label "test 2" return > var3: radio label "test 3" return > I cannot create var... > Can someone help me?
Hi, use 'to-set-word to create a set word, which I think is what you're after. Example... rebol [] lo: [ across ] for n 1 3 1 [ append lo to-set-word join "var" n append lo [ radio [show-data] label ] append lo join "Test " n append lo to-set-word join "var-data" n append lo [field return] ] show-data: does [ var-data1/text: var1/data var-data2/text: var2/data var-data3/text: var3/data show [var-data1 var-data2 var-data3] ] view layout lo HTH. -- Carl Read