Scroll bars in text-lists not working in Rebol 2
Hello! I am using Rebol-view 278-3-1 on a Windows 10 I am trying to write a program that includes 3 text-lists. The second is populated depending on a selection made with the first text-list. The third one is populated by a selection made in the second. What I see is that when the GUI is first drawn, if the contents of a text-list don’t fit (given the dimensions of the text-list) then the scroll bars in the text-list work, giving me access to the extra elements on the list. As the second text-list is empty (when the GUI is first drawn) all “contents fit”, but if I select an option that populates more items that what the second text-list can show, the scroll bars don't work, and I can’t access the rest of the elements. This happens whether I ask to “show” the particular text-list or the entire GUI. Does anyone know a workaround? Thanks in advance!
posted by: brother Damian 18-Jan-2022/15:20:54-8:00
To illustrate the problem. Say: info: [“item1” “item2” “item3” “item4” “item5” “item6” “item7” “item8” “item9” “item10” “item11” “item12” “item13” “item14” “item15”] view layout [title “Scroll bars test” l1: text list data info] We should see the text-list with a default size showing some of the elements in the info series AND scroll bars that give us access to the rest. If instead we go view layout [title “Scroll bars test” l1: text-list] At this moment we should see a text-list with no info and therefore scroll bars that are not enabled. The problem happens now, if we load the text-list with data that goes beyond the viewable area, the scroll bars will not help us access it. view layout [title “Scroll bars test” l1: text-list btn “Load Info” [l1/data: info show l1] ] So, to reiterate, how can I have the scroll bars activate when the new data set is loaded? Thanks in advance!
posted by: Brother Damian 19-Jan-2022/14:24:24-8:00
hi! I'm not sure I understood the problem correctly, but try refinement /update. For example, a small file viewer - select a file in the first list, the content is updated in the second: >> view layout[text-list data read %. [b/data: read value b/update show b] b: text-list] to see all possible options try: >> ? b B is an object of value: type word! face offset pair! 20x228 size pair! 200x200 span none! none pane object! [type offset size span pane text color image effec... text string! "" color tuple! 240.240.240 image none! none effect none! none data block! length: 0 ... text-pane function! [face id] update function! [/local item value] resize function! [new /x /y /local tmp] to see source object "b": >> source b ... many text...
posted by: Sergey_Vl 20-Jan-2022/5:02:45-8:00
hi! I'm not sure I understood the problem correctly, but try refinement /update. For example, a small file viewer - select a file in the first list, the content is updated in the second: >> view layout[text-list data read %. [b/data: read value b/update show b] b: text-list] to see all possible options try: >> ? b B is an object of value: type word! face offset pair! 20x228 size pair! 200x200 span none! none pane object! [type offset size span pane text color image effec... text string! "" color tuple! 240.240.240 image none! none effect none! none data block! length: 0 ... text-pane function! [face id] update function! [/local item value] resize function! [new /x /y /local tmp] to see source object "b": >> source b ... many text...
posted by: Sergey_Vl 20-Jan-2022/5:02:48-8:00
Thank you Sergey_VI, that indeed solves the problem. After the update, the scroll bars become active as needed. Following my example and your recommendation, the code needs to be amended as so: view layout [title “Scroll bars test” l1: text-list btn “Load Info” [l1/data: info l1/update show l1] ]
posted by: Brother Damian 21-Jan-2022/3:04:52-8:00
|