[REBOL] Re: text-list questions (probably answered before)
From: agem::crosswinds::net at: 17-Apr-2001 17:57
an older fix by me (works in 1.0 too).
extract the style somehow from the demo ;-)
Volker
[REBOL [
Title: "Korrigiert Text-list, Demo"
Date: 27-Jan-2001/23:39:17+1:00
Name: "text-list'"
Version: 0.9
File: %textlist-patch1.r
Home: http://jove.prohosting.com/~screbol/
Author: "volker"
Owner: "volker"
Rights: "gpl"
Needs: [view 0.10.38]
Tabs: none
Usage: none
Purpose: none
Comment: none
History: [27-Jan-2000 ""]
Language: "german"
]
patched: context [
l: last-shown-lines: styles: text-list': update-slider:
none
[
]
[
%tlp2.r
]
styles: stylize [
text-list': text-list with [
"add size-change scrolling"
last-shown-lines: -1
update-slider: does [
either 0 = length? data [sld/redrag 1] [
sld/redrag lc / length? data]
]
append init [
sub-area/feel/redraw: does [
l: length? data
if l <> last-shown-lines [
last-shown-lines: l
update-slider
]
]
]
"leere liste erlauben."
words/data:
func [new args] [
if not empty? second args [
new/text: first new/texts: second args
]
next args
]
]
]]
test:
func [
/local fix-slider lo my-styles tl1 tl2 tl3
] [
[
%tlp.r
]
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]
]
]
my-styles: patched/styles
lo: layout [backdrop gold / 2
styles my-styles
text 600 wrap { die text-list hat zwei fehler:
bei datena&nderungen wird der scrollbereich nicht vera&ndert
und leere listen funktionieren nicht.
hier ist eine Korrektur}
guide
text "original-textlist"
tl1: text-list data [1 2 3 4 5]
button "add" [append tl1/lines [7 8 9 0]
show tl1]
return
text "textlist mit workaround"
tl2: text-list data [1 2 3 4 5]
button "add" [append tl2/lines [7 8 9 0]
fix-slider tl2 show tl2]
return
text "text-list', korrigiert"
tl3: text-list' data [1 2 3 4 5]
button "add" [append tl3/lines [7 8 9 0]
show tl3]
]
view lo]
test
]