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 three submorphs
Last updated at 7:04 pm UTC on 12 September 2016
| container m1 m2 m3 |

container := AlignmentMorph newColumn.
container color: Color blue .
container  hResizing: #shrinkWrap; 
     vResizing: #shrinkWrap.


m1 := StringMorph new 
           contents: 'A title (made with a StringMorph)'; 
           color: Color white.
m1 hResizing: #spaceFill.

m2 := Morph new color: Color lightGray.
m2 extent: 320@180.


 m3 := SimpleButtonMorph new
 		label: 'close';
 		target: container; 
 		actionSelector: #delete.
 
 container addMorph: m1.
 container addMorphBack: m2.
 container addMorphBack: m3.
 
 container openInHand

AlignmentMorph_with_SimpleButtonMorph_as_close_button.png

This example works fine in Squeak 5.1 and Pharo 5.0.