Recipe: Create a window with scrollable contents - example 4
Last updated at 2:48 am UTC on 25 August 2019
from: http://stackoverflow.com/questions/34722545/how-to-make-a-scrollpane-adjust-to-its-content
| rows sp |
rows := Morph new
layoutPolicy: TableLayout new;
listDirection: #topToBottom;
color: Color white.
sp := ScrollPane new extent: 240@100.
sp scroller addMorph: rows.
rows addMorphBack: (RectangleMorph new color: Color red).
rows addMorphBack: (RectangleMorph new color: Color blue).
sp openInWindow.
rows addMorphBack: (RectangleMorph new color: Color green).
rows addMorphBack: (RectangleMorph new color: Color yellow).
rows addMorphBack: (RectangleMorph new color: Color black).
rows addMorphBack: (RectangleMorph new color: Color white).
sp setScrollDeltas.

The diagram below is an SRE collaboration diagram.
