Layout of a simple table (cellInset)
Last updated at 3:50 am UTC on 26 July 2020
| parent1Side cellSide cell |
parent1Side := 320.
cellSide := 50.
parent1 := Morph new.
parent1 width: parent1Side.
parent1 height: parent1Side.
parent1 color: Color white.
parent1 layoutPolicy: TableLayout new.
parent1 listDirection: #leftToRight.
parent1 wrapCentering: #topLeft.
parent1 wrapDirection: #topToBottom.
parent1 layoutInset: 18@18.
parent1 cellInset: 8@8.
1 to: 25 do: [:i | cell := EllipseMorph new.
cell height: cellSide. cell width: cellSide.
cell color: Color random twiceLighter twiceLighter twiceLighter.
cell borderWidth: 0.
parent1 addMorphBack: cell
].
parent1 openInWorld.

The code above (with background color slightly changed) executed in Squeak 5.3 produces the following result.

This is because #cellInset: is has been changed (see release notes).
Using #cellGap: instead brings back:

Adapted from MorphLayoutArticle, first exercise.
