[REBOL] Re: Info on 'list style
From: felixs:ihug:au at: 17-Apr-2002 6:06
I had the same problem but I found
I played with it a little and ended up with this
( I took out the 3l33t column sorting bit though ;)
row-item: make object! [
val1: copy ""
val2: copy ""
val3: copy ""
list-data: copy 
for i 1 50 1 [ append list-data make row-item [ val1: reform ["Item" i]
val2: "Column number 2" val3: "Col 3"] ]
onSel: func [row-index] [
itm: pick list-data row-index
if none? itm [exit]
print reform ["picked:" itm/val1]
;- For the scroll bar
data-list: layout [
button "Col1" 50
button "Col2" 180
button "Col3" 74
tbl: list 300x200 [
txt 50x20 [sel: curr unfocus show tbl onSel sel]
txt 180x20 [sel: curr unfocus show tbl onSel sel]
txt 74x20 [sel: curr unfocus show tbl onSel sel]
] supply [
curr: count + cnt
face/text: copy ""
if even? count [face/color: ivory - 20.20.20]
row-itm: pick list-data curr
if none? row-itm [exit]
switch index [
1 [ str: row-itm/val1 ]
2 [ str: row-itm/val2 ]
3 [ str: row-itm/val3 ]
if sel = curr [face/color: 160.255.160]
sld: slider 16x200 [
c: max 0 to-integer (length? list-data) * value
if c <> cnt [cnt: c show tbl ]
One thing I'm not sure of how to do though, is to make this into a reusable
widget. Could anyone give me an idea of where to start on that?
----- Original Message -----
From: "alan parman" <[reboler--programmer--net]
Sent: Tuesday, April 16, 2002 11:05 AM
Subject: [REBOL] Re: Info on 'list style
> Thanks for the pointers, Anton and Geza!
> I now have nearly complete success with what I wanted to do with 'list and
> One more thing though, if you all would be so kind...
> Anton's scroller demo is still a bit complex for me (especially given that
I am still learning the 'list style). Anton, the demo mentions that your
special scroller style is not necessary for scrolling a 'list.
> What are the essentials for scrolling a 'list?
> (I know about 'scroll-para and have and have used 'crop on images, and
investigated the origin method, but none of these work on 'list). Is it
similar to a 'text-list, with face/sld/data and face/sn, etc?