[REBOL] Re: Refresh LIST data
From: anton:lexicon at: 29-Oct-2002 0:42
Hi Fabrice, try these alternatives:
1) Find where the list stores the pointer to the data block:
button brick "Change data" [
stuff: second second get in lstforum 'subfunc
append clear stuff [ ["Sujet 1" "Date 1"] ["Sujet 2" "Date 2"] ["Sujet 3"
Date 3
] ]
show lstforum
]
2) Use a supply function:
forum: copy [ ["Elément 1" "Colonne 1"] ["Elément 2" "Colonne 2"] ["Elément
3" "Colonne 3"] ]
view center-face layout [
below
lstforum: list leaf 300x100 [
across txt1: text 100 txt2: text 100
] data forum supply [
txt1/text: all [(row: pick head forum count) (pick row 1)]
txt2/text: all [(row: pick head forum count) (pick row 2)]
]
button brick "Change data" [
append clear forum [ ["Sujet 1" "Date 1"] ["Sujet 2" "Date 2"] ["Sujet 3"
Date 3
] ]
show lstforum
]
button "Close" [ unview ]
]
Two important changes:
1) added a supply function, this allows the faces to be updated
after the initial setting.
2) in "Change data", we are modifying the original block.
By the way, don't expect to understand how this works
very quickly. I still learned some things figuring this
out today.
Anton.