[REBOL] Re: updating text-list
From: agem:crosswinds at: 9-Jul-2001 15:59
RE: [REBOL] Re: updating text-list
[brett--codeconscious--com] wrote:
> Hi Thorsten,
>
> It appears that one needs to update the slider. Here's one way to go that
> uses a new style to define a function
> that updates the slider.
>
> view layout [
> style updatable-text-list text-list
> with [
> update-slider: does [
> sld/redrag lc / max 1 length? head lines
> ]
> ]
> tl: updatable-text-list 300x100 data copy system/locale/months
> button "Delete first" [
> remove tl/data tl/update-slider show tl
> ]
> button "Append now" [
> append tl/data mold now tl/update-slider show tl
> ]
> ]
>
extended that a bit, now it checks for size-change in show.
volkers-styles: stylize [
volkers-text-list: text-list with [
"add size-change scrolling"
last-shown-lines: -1
update-slider: does [
sld/redrag lc / max 1 length? head lines
]
append init [
sub-area/feel/redraw: has[l] [
l: length? data
if l <> last-shown-lines [
last-shown-lines: l
update-slider
]
]
]
]
]
> HTH
> Brett.
>
-Volker