links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
AlignmentMorph newRow
Last updated at 5:22 pm UTC on 23 February 2017
The method #newRow is a convenience method in AlignmentMorph to get layout behaviour for submorphs.

AlignmentMorph newRow 
addMorph: (EllipseMorph new extent: 40@40; color: Color red);
addMorph: (EllipseMorph new extent: 50@50; color: Color yellow);
addMorph: (EllipseMorph new extent: 60@60; color: Color green);
addMorph: (EllipseMorph new extent: 70@70; color: Color blue);
position: 20@20;


In Pharo

Try also newColumn instead of newRow.
Try using addMorphBack: instead of addMorph.

Useful for example to build simple tools with SimpleButtonMorphs or PluggableButtonMorphs.


What is the difference between

| a |
a:= AlignmentMorph newRow.
10 timesRepeat: [a addMorph: (EllipseMorph new color: Color random)].
a openInWorld

| a coll |
	coll := OrderedCollection new.
	10 timesRepeat: [coll add: (EllipseMorph new color: Color random; extent: 40@40)].
	a:= AlignmentMorph inARow: coll.
	a openInWorld

See also Example - aRectangleMorph addMorph: anotherMorph for layout of submorphs of a RectangleMorph.