[REBOL] Scrolling question
From: kpeters::otaksoft::com at: 9-Aug-2007 9:47
I have tried to marry Carl's example on "Adding a scrollbar to text" to the source of
request-list because I need to let my users choose from very wide strings and thus also
require a horizontal scrollbar.
Carl defers calling reset-tface by moving it into the action of his example's button;
click on his scrollbar before opening a file via the button, the script dies. So does
I believe I need to call reset-tface bu tI can't seem to figure out how to call it from
It seems to me that (part of?) the problem is that one cannot refer to a "named" face
while still executing/being in layout? Is that a valid assessment?
Could someone kindly help me out with this one?
As always, any help is much appreciated.
request-list: func [titl [string!] alist [block!] listboxsize [pair!] /offset xy /local
rslt list-lay ][
reset-tface: func [txt bar][
update-tface txt bar
show [txt bar]
scroll-tface: func [txt bar][
txt/para/scroll/x: negate bar/data * (max 0 txt/user-data - txt/size/x)
update-tface: func [txt bar] [
txt/user-data: second size-text txt
bar/redrag txt/size/x / txt/user-data
list-lay: layout [
space 0 ; hug the text box
tl: text-list listboxsize font-name font-fixed data alist [rslt: value hide-popup]
sb: scroller to-pair reduce [ first listboxsize 16 ] listboxsize [ scroll-tface tl sb
; reset-tface tl sb
btn-cancel #"^[" [rslt: none hide-popup]
either offset [inform/offset list-lay xy] [inform list-lay]