[REBOL] how to refresh fields in a VID list? Re:
From: allen:rebolforces at: 20-Sep-2000 15:39
Seeing no one has answered this yet.
Here is how you can do it. I've added a few buttons to help demonstrate it
To make it work you need to provide your own handler for the row in the list
by using 'supply
>From within block that you provide for 'supply, you have access to the word
'count, this is the index of the row you that you supplying data for. Count
is in incremented from 1 to the max number of rows showing in the list.
The faq.r script in the View Test Panel, is a good example to study for
other things that can be done with List.
p.s This example does not show how to edit directly in the list, there are
some issues with doing that, at this stage I would suggest just using lists
to display data.
Here is a reworking of your example
block: copy [
["ssql" "www.somewhere.com" "a-o.dll-eUK-osform_template=awake.t" "388"]
["ping" "188.8.131.52" "" "5"]
view layout [
button "Add Stuff" [append/only block reduce ["Random Data" random
255.255.255.255 "--" random 2000] show mylist]
button "Remove Top" [remove block show mylist]
button "Sort" [sort block show mylist]
mylist: list 850x400 80.80.80 [across f1: field f2: field f3: field f4:
field] data block
; print count ;--for debugging
either none? row: pick head block count [
f1/text: pick row 1
f2/text: pick row 2
f3/text: pick row 3
f4/text: pick row 4