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

[REBOL] VID List 'supply function and dynamic widget reinitialization

From: geza67::freestart::hu at: 23-Apr-2002 21:37

Hello REBOLers, A week ago or two I got nice ideas to reinitialize/redraw toggles in an iterated list. Now I am stuck with a more complex structure, namely the rotary. I tried several initialization strategies, some of them even did not let to "rotate" the rotary, i.e. it stayed the same. The model below characterizes best my wishes: I store the state (the 'index? of 'data list) of the rotary in a global context list, where the n-th cell will be set to 'index? In the scenario n is the row count of the list, thus the 'count word of the 'supply function. rebol[] c: ["1" "2" "3" "4"] l: ["first" "second" "third" "fourth"] view layout [ list 600x400 [ across cnt: info "1" answer: rotary 240 [ poke a to-integer cnt/text index? answer/data ] data copy head l ] supply [ if count > length? l [face/show?: false exit] face/show?: true switch index [ 1 [ face/text: pick c count ] 2 [ face/text: probe pick l a/:count ] ] ] do [a: [1 1 1 1]] ] Unfortunately, the code - the intention, to set the variables in the action block of the rotary and restore their state in the supply function, is not working. It seems that answer/data is common among ALL list rows - clicking on any row will advance the common 'data list to the next slot, thus answer/data is not individual(separate) amongst the list rows. All seems to spurious to me: is the supply function Janus-faced, i.e. represents "read" _and_ "write" states: I thought, that the action block of the actual widget in a list could be used to store its state, and the supply routine could read this state and redraw the screen element accordingly. I thought, the kind of reinitialization I used int the above is useful, but it seems, it is not :-( -- Best regards, Geza Lakner MD mailto:[geza67--freestart--hu]