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

[REBOL] Re: Info on 'list style

From: geza67:freestart:hu at: 12-Apr-2002 20:40

Hello Alan, Here is a quite simple simple solution: rebol [] m-l-c: [ ["from1" "subject1" "contents1"] ["from2" "subject2" "contents2"] ["from3" "subject3" "contents3"] ] view layout [ below list 550x180 [ btn: button [probe reform [btn/text fld1/text fld2/text]] fld1: field fld2: field ] supply [ if count > length? m-l-c [face/show?: false exit] face/show?: true face/text: m-l-c/:count/:index ] ] Points to keep in mind when designing an iterated list: - harmonize the overall list size and the sizes of the individual items in the list - 'count holds the iterated row number - 'index holds the face index in the row (in the above example, as faces appear in the layout they are linked to the data consecutively: 'btn = 1, 'fld1 = 2, 'fld2 = 3 - faces WILL be iterated to the total height of the list - in the 'supply block setting the face/show? to 'false is _vital_ to hide obsolete extra (repeating the list row!) elements; in this algorithm "overflow" of the iteration is prohibited by the 'if control structure. If you want a list with a scrollbar, look at Anton's rebsite for vid-usage.r and merge in its slider code. -- Best regards, Geza mailto:[geza67--freestart--hu]