[Q] scrolling large collections

Ned Konz ned at bike-nomad.com
Wed Apr 9 16:52:39 UTC 2003


On Wednesday 09 April 2003 08:56 am, Martin Drautzburg wrote:
> If I want to display items from a list of say a million entries I
> can do this with the available ListMorphs. But theses only display
> text. What if my items have a graphical (Widget) representation
> (for simplicity lets assume they all have the same height).
>
> I certainly cannot draw them all and the clip to the visible parts.
> I thought I could display a fixed set (say 8) of them and then
> change the models of the visible representation when scolling is
> done.
>
> I just cannot figure out how the ScrollPane works. How do the
> events from the scrollbar reach the TransformMorph that does the
> actual scrolling ? Is there a place where I could plug in my own
> way of scrolling.

The slider in the ScrollBar sends #scrollBarValue: (or some other 
pluggable selector) to its model, which is often a PluggableListMorph 
(which is of course a ScrollPane). Then the PLM sends #offset: to its 
scroller (which is a MorphicTransform).

The way that the ScrollPanes work, though, is that they tend to draw 
everything and count on clipping to do the work.

You may want to look at Lex's "Large Lists" change set, which 
optimizes the display of very large lists.

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE



More information about the Squeak-dev mailing list