[Q][Morphic] Is there a FlowLayout manager?

Tim Olson tim at io.com
Sat Mar 15 13:39:34 UTC 2003


Hannes Hirzel <hannes.hirzel.squeaklist at bluewin.ch> wrote:
| Hi
| 
| I'd like to use something like Java's FlowLayout manager to layout
| submorphs of a Morph

I'm not familiar with "FlowLayout", but from the name, is this perhaps
what you want?  (Note the addition of the listDirection, wrapCentering,
and wrapDirection messages):

----
cont _ Morph new.
cont width: 200.
cont height: 150.
cont layoutPolicy: TableLayout new;
	listDirection: #leftToRight;
	wrapCentering: #topLeft;
	wrapDirection: #topToBottom.


20 timesRepeat: [ m_ Morph new. 
                     m height: 25. 
                     m color: Color random. 
                     m width: m width + 20 atRandom - 10. 
                     cont addMorph: m
                   ].
cont openInWorld.
----

	-- tim



More information about the Squeak-dev mailing list