Squeak
  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;
openInWorld


AlignmentMorph_newRow_2016-08-27.png

In Pharo
AlignmentMorph_newRow_Pharo5.0_2016-08-30.png


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


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

inARow:


What is the difference between

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

and
| 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.