[GOODIE] AdjacencyLayout-ajh (was: Finding open space?)

Anthony Hannan ajh18 at cornell.edu
Mon Nov 25 18:22:44 UTC 2002


from preamble:

"Change Set:		AdjacencyLayout-ajh
Date:			25 November 2002
Author:			Anthony Hannan

Send 'layoutPolicy: AdjacencyLayout new' to any Morph to make its
submorphs never overlap.  Have a submorph return false to the
'beAdjacent' message if it should ignore this no overlap rule.

Try the example below, and drag/resize/add morphs to see what happens. 
Morphs in front take precedence.  Dragging a morph by its move handle
automatically puts it in front.  Morphs try to stay as close to their
orginal position as possible.  Their original position is reset when
moved or its owner is moved.

	PasteUpMorph new
		extent: 200 at 200;
		layoutPolicy: AdjacencyLayout new;
		addMorph: (Morph new color: Color red; position: 80 at 80);
		addMorph: (Morph new color: Color gray; position: 80 at 80);
		addMorph: (Morph new color: Color blue; position: 80 at 80);
		openInHand
"!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AdjacencyLayout-ajh.cs.gz
Type: application/octet-stream
Size: 4049 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20021125/86c1d3e3/AdjacencyLayout-ajh.cs.obj


More information about the Squeak-dev mailing list