Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Recipe: Create a window with scrollable contents - example 4
Last updated at 8:58 pm UTC on 18 April 2017
from: http://stackoverflow.com/questions/34722545/how-to-make-a-scrollpane-adjust-to-its-content

 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.



ScrollPane.png
The diagram below is an SRE collaboration diagram.
ObjectCollaboration_SystemWindow_ScrollPane_TransformMorph.png