[REBOL] Re: How do I update a text-list?
From: gjones05:mail:orion at: 17-Apr-2001 12:38
From: alan parman
> How do I update a text-list? I can change the data it is based on, but
when
> I 'show' the text-list, nothing happens. I've tried text-list/data,
> text-list/text, text-list/texts, text-list/lines, to no avail.
Hi, Alan,
view layout [
tl: text-list data ["a" "b" "c"]
button "Change List" [
tl/lines: ["new" "values" "for" "you"]
show tl
]
]
Your next question will then be, if the list items grow too long for the
box, how does one update the slider on the side:
; modification based on original by Sterling
; updates the bar on the side of a text-list or group of text-lists
fix-slider: func [faces [object! block!]] [
foreach list to-block faces [
either 0 = length? list/lines [
list/sld/redrag 1
][
list/sld/redrag list/lc / length? list/lines
]
]
]
view layout [
tl: text-list 100x50 data ["a" "b" "c"]
button "Change List" [
tl/lines: ["new" "values" "for" "you"]
fix-slider tl
show tl
]
]
Hope this does the trick.
--Scott Jones