Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
How to lay out submorphs - example 4
Last updated at 4:42 pm UTC on 2 July 2005
Craig Latta asked Mon, 04 Feb 2002 on the mailing list:
> I'd like to nest a proportional layout in a table layout.

Bob Arning gave an example:
Morph new
	color: Color green;
	extent: 300 @ 300;
	layoutPolicy: ProportionalLayout new;
	addMorph: (
		Morph new color: (Color blue alpha: 0.5)
	)
	fullFrame: (
		LayoutFrame
                    fractions: (0@1 corner: 1 @ 1) offsets: (0@100 negated corner: 0@0)
	);

	addMorph: (
		Morph new
			color: (Color red alpha: 0.5);
			layoutPolicy: ProportionalLayout new;
			addMorph: (
				Morph new
					color: (Color yellow alpha: 0.5);
					layoutPolicy: TableLayout new;
					listDirection: #topToBottom;
					listCentering: #center;
					addMorph: (
						Morph new extent: 100@2; color: Color black; hResizing: #spaceFill
					)
			)
			fullFrame: (LayoutFrame fractions: (0@0 corner: 0.9 @ 0.9) offsets: nil)
	)
	fullFrame: (
		LayoutFrame fractions: (0@0 corner: 1 @ 1) offsets: (0@0 corner: 0@100 negated)
	);
     openInWorld