Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

How do I update a text-list?

 [1/7] from: reboler::programmer::net at: 17-Apr-2001 12:43


How do I update a text-list? I can change the data it is based on, but when I 'show' the text-list, nothing happens. I've tried text-list/data, text-list/text, text-list/texts, text-list/lines, to no avail.

 [2/7] from: peoyli:algonet:se at: 17-Apr-2001 19:32


Hi,
> How do I update a text-list? I can change the data it is based on, but when > I 'show' the text-list, nothing happens. I've tried text-list/data, > text-list/text, text-list/texts, text-list/lines, to no avail.
I got the answer to this question even if it wasn't that I asked for.. so.. [ REBOL [] 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 ] ] ] ch: #"b" l: layout [ tl: text-list 100x150 data ["a"] button "Add something" [ append tl/data ch ch: ch + 1 fix-slider tl show tl ] ] view center-face l ] /PeO

 [3/7] from: gjones05:mail:orion at: 17-Apr-2001 12:38


From: alan parman
> How do I update a text-list? I can change the data it is based on, but
when
> I 'show' the text-list, nothing happens. I've tried text-list/data, > text-list/text, text-list/texts, text-list/lines, to no avail.
Hi, Alan, view layout [ tl: text-list data ["a" "b" "c"] button "Change List" [ tl/lines: ["new" "values" "for" "you"] show tl ] ] Your next question will then be, if the list items grow too long for the box, how does one update the slider on the side: ; 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 ] ] ] view layout [ tl: text-list 100x50 data ["a" "b" "c"] button "Change List" [ tl/lines: ["new" "values" "for" "you"] fix-slider tl show tl ] ] Hope this does the trick. --Scott Jones

 [4/7] from: reboler:programmer at: 17-Apr-2001 14:22


Thanks a bunch, it does indeed work. I could swear that I tried "/lines" and it didn't work. Was this something that changed in View1.0 from the experimental versions? ------Original Message------ From: "GS Jones" <[gjones05--mail--orion--org]> To: <[rebol-list--rebol--com]> Sent: April 17, 2001 5:38:53 PM GMT Subject: [REBOL] Re: How do I update a text-list? From: alan parman
> How do I update a text-list? I can change the data it is based on, but
when
> I 'show' the text-list, nothing happens. I've tried text-list/data, > text-list/text, text-list/texts, text-list/lines, to no avail.
Hi, Alan, view layout [ tl: text-list data ["a" "b" "c"] button "Change List" [ tl/lines: ["new" "values" "for" "you"] show tl ] ] ....

 [5/7] from: gjones05:mail:orion at: 17-Apr-2001 13:51


From: "alan parman"
> Thanks a bunch, it does indeed work. I could swear that I tried "/lines" > and it didn't work. Was this something that changed in View1.0 from the > experimental versions?
To my knowledge, no. I find it very easy to make mistakes when using the dialects, like VID. What I still don't understand is why /data works with append, as in the following: view layout [ tl: text-list data ["a" "b" "c"] button "Change List" [ append tl/data ["new" "values" "for" "you"] show tl ] ] but can't be assigned directly, as in the following: ;doesn't work view layout [ tl: text-list data ["a" "b" "c"] button "Change List" [ tl/data: copy ["new" "values" "for" "you"] show tl ] ] Oh, well. --Scott Jones

 [6/7] from: reboler:programmer at: 17-Apr-2001 16:09


I think I originally tried your second way below, as well. ;didn't work ...addrlist is a text-list with original data... ... addrlist/****: names-only ; how update a text-list data = ??? show addrlist ... Where **** = [data lines text texts etc etc etc] Now, ;this works ... addrlist/lines: copy names-only show addrlist .... Your question is a good one? Why can't you directly change text-list/data? ------Original Message------ From: "GS Jones" <[gjones05--mail--orion--org]> To: <[rebol-list--rebol--com]> Sent: April 17, 2001 6:51:44 PM GMT Subject: [REBOL] Re: How do I update a text-list? From: "alan parman"
> Thanks a bunch, it does indeed work. I could swear that I tried "/lines" > and it didn't work. Was this something that changed in View1.0 from the > experimental versions?
To my knowledge, no. I find it very easy to make mistakes when using the dialects, like VID. What I still don't understand is why /data works with append, as in the following: view layout [ tl: text-list data ["a" "b" "c"] button "Change List" [ append tl/data ["new" "values" "for" "you"] show tl ] ] but can't be assigned directly, as in the following: ;doesn't work view layout [ tl: text-list data ["a" "b" "c"] button "Change List" [ tl/data: copy ["new" "values" "for" "you"] show tl ] ] Oh, well. --Scott Jones

 [7/7] from: agem:crosswinds at: 17-Apr-2001 23:57


>From: "alan parman" >> Thanks a bunch, it does indeed work. I could swear that I tried "/
lines"
>> and it didn't work. Was this something that changed in View1.0 from
the
>> experimental versions? > >To my knowledge, no. I find it very easy to make mistakes when using
the
>dialects, like VID. > >What I still don't understand is why /data works with append, as in
the
>following: >view layout [
<<quoted lines omitted: 13>>
>] >]
i think list copies the refercence from data to somewhere else too. then appending to data appends to the same block this second referecne knows, but replacing it lets data point to another, while the internal ref points to the old?
>Oh, well. >--Scott Jones >
Volker

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted