Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
TableLayout
Last updated at 4:54 pm UTC on 16 January 2006
....

The following example shows how the TableLayout policy may be used to produce a Java FlowLayout manager like effect

 | cont |

 cont _ Morph new.
 cont width: 200.
 cont height: 150.

 cont layoutPolicy: TableLayout new.
 cont listDirection: #leftToRight.
 cont wrapCentering: #topLeft.
 cont wrapDirection: #topToBottom.

 
 20 timesRepeat: [ m_ Morph new. 
                   m height: 25. 
                   m color: Color random. 
                   m width: m width + 20 atRandom - 10. 
                   cont addMorph: m
                 ].

 cont openInWorld.