[REBOL] Re: Area Resizing
From: antonr:iinet:au at: 23-Sep-2003 16:31
Can you send a simple example script, complete,
so we can see exactly what you mean?
I have a list + scroller demo here:
http://www.lexicon.net/anton/rebol/gui/demo-vid-list-scroller.r
Here is an excerpt that might fix you up quickly:
refresh: func [
/local visible non-visible-part
][
l-block: copy []
; ensure current position can show all its data
visible: n-rows / length? list-data
scroll/data: max min scroll/data (1.0 - visible) 0.0
;scroll/data: 0 ; current position first row
;prepare-list-block 1 ; show from first row
prepare-list-block 1 + to-integer ((length? list-data) - 1 * scroll/data)
; overall size of the scroller, height same as list
scroll/size: to-pair reduce [16 max list-size/y 16]
non-visible-part: (length? list-data) - n-rows
; arrow buttons cause the slider to move by the value of step
scroll/step: either zero? non-visible-part [0][1 / non-visible-part]
; size of the slider (the drag bar)
scroll/redrag (n-rows / length? list-data)
show [my-list scroll]
]
Anton.