[REBOL] Re: text-list questions (probably answered before)
From: gjones05:mail:orion at: 17-Apr-2001 9:50
From: "P-O Yliniemi"
> Here is a collection of text-list related problems I have gotten so
> far:
>
> 1. how do I set the slider to the 'correct' position on a rebuild ?
Sterling's /View beta fix was:
fix-slider: func [faces [object! block!]] [
foreach list to-block faces [
either 0 = length? list/data [
list/sld/redrag 1
][
list/sld/redrag list/lc / length? list/data
]
]
]
As was addressed two emails ago, I modified his for reasons that I don't
precisely recall, but if his doesn't work at some point, try:
; 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
]
]
]
These are used as such:
view layout [
tl: text-list 100x50 "a" "b" "c" [
tl/lines: ["new" "values" "for" "you"]
fix-slider tl
show tl
]
]
I don't recall the answer to #2 and I don't recall ever knowing how to do
#3, but I suspect it will require a custom face based on list, instead of
text-list.
Hope others know the answers.
--Scott Jones