Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
AlignmentMorph newColumn example with EllipseMorph
Last updated at 11:11 pm UTC on 6 June 2018
Copy the following code into a Workspace and execute it. Message cascading is used to contruct m1, m2 and m3 (extent and color).

The message #openInHand means that the resulting morph m is attached to the cursor and needs to be placed on the desktop.

In addition a picture snapshot (like a screen shot - the "image form") is written to a PNG file.

 | m m1 m2 m3 |
  m := AlignmentMorph newColumn cellPositioning: #topLeft; color: Color gray.
 m hResizing: #shrinkWrap.
 m vResizing: #shrinkWrap.
 
  m1 := EllipseMorph new extent: 70@70; color: Color red.
  m addMorphBack: m1.
 
  m2 := EllipseMorph new extent: 70@70; color: Color orange.
  m addMorphBack: m2.
 
  m3 := EllipseMorph new extent: 70@70; color: Color green.
  m addMorphBack: m3.
 
 
 m openInHand.
 
 PNGReadWriter
 	putForm: m imageForm 
 	onFileNamed: 'myImage.png'.
TrafficLightMorph_2017-10-30.png

See also
AlignmentMorph newColumn example with three submorphs

tagBeginner