ListView horizontal scrollbar?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

ListView horizontal scrollbar?

Jerome Chan
Is there a way to scroll a listview containing a listmodel horizontally?


Reply | Threaded
Open this post in threaded view
|

Re: ListView horizontal scrollbar?

Ian Bartholomew
Jerome,

> Is there a way to scroll a listview containing a listmodel horizontally?

Not 100% sure what you are asking here. However, if it is concerned with
getting the horizontal scroll bar to be displayed in a ListBox then there is
a little twist that you might have missed. ListBox has two settable aspects
involved in this :

canHScroll - this must be set to true (the default)
horizontalExtent - this must be set to the required width of the ListBox
(the default is 0 which results in the scroll bar never being displayed)

For example

lp := ListPresenter show.
lp topShell view extent: 200@200.
lp list: #('item 1' 'item 2' 'a very very very very very very long item 3'
'item 4').

results in a ListBox that needs a scroll bar but doesn't display it. Now
evaluate

lp view horizontalExtent: 300.

and the scroll bar should miraculously appear.

NB. The above is just a demo. You should normally set these aspects when you
create the composite view in the View composer.

Ian