Home   Archive   Permalink

Possible bug with text-list?

If you add more items to a text-list than can fit within the size of the text-list, it doesn't add a scroll bar.
If there are already too many items in the text-list when the program is run, then there is a scroll bar. But when you remove items, the scroll bar stays the same size.
R E B O L [title: 'test']
view center-face layout [
     a: text-list 200x100 data ''
     btn 'add item a' [append a/data '*'] btn 'remove item a' [clear back tail a/data] return btn 'show a' [show a] btn 'reset-face a' [reset-face a] return
     b: text-list 150x50 data ['*''*''*''*''*''*''*''*''*''*']
     btn 'add item b' [append b/data '*'] btn 'remove item b' [clear back tail b/data] return btn 'show b' [show b] btn 'reset-face b' [reset-face b] return

posted by:   Andrew       11-May-2017/21:39:38-7:00

You have to add your own scroll bar.

posted by:   Graham       11-May-2017/22:03:32-7:00

I found a fix at http://www.codeconscious.com/rebol/vid-notes.html
fix-slider: func [faces [object! block!]] [
     foreach lv-list to-block faces [
         ; print [length? head lv-list/lines lv-list/lc]
         lv-list/sld/data: 0
         lv-list/sn: 0 ; this is the Romano's change
         lv-list/sld/redrag lv-list/lc / max 1 length? head lv-list/lines
         show lv-list

posted by:   Andrew       12-May-2017/17:57:27-7:00