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

[REBOL] Re: Text-List more help please

From: gjones05:mail:orion at: 25-May-2001 17:57

From: "Ammon Cooke"
> Which also only deleted one item no > matter how many where selected. I would > additionally like to be able to reference the > data in the list like an index. i.e. how do I > know how many items are in the list? > Can I access an item from an index number??
This sample adds a label that reflects how many items are in the list. This label is initialized in the 'do block, which is run once upon evaluation. One can also select multiple items for deletion. I am unsure whether I understand what your last question is asking. fix-slider: func [faces [object! block!]] [ foreach list to-block faces [ list/sld/redrag list/lc / max 1 length? head list/lines ] ] view layout [ txt "Select items to delete, then click button" tl1: text-list 150x50 data ["apples" "oranges" "bananas" "pears" kiwi ] across txt "Items in list: " t1: txt 80 below button "Delete" [ foreach p tl1/picked [ remove find tl1/data p] tl1/data: head tl1/data fix-slider tl1 t1/text: to-string length? tl1/data show [tl1 t1] ] do [ t1/text: to-string length? tl1/data show tl1 ] ] ;;;;; --Scott Jones