[squeak-dev] TextMorph takes to much space in layout

r2ruyu-nana at yahoo.de r2ruyu-nana at yahoo.de
Sat Aug 13 15:34:52 UTC 2011


Hello squeaker!

A TextMorph takes to much space in a table layout:

	parent := Morph new color: Color yellow.
	parent
		changeTableLayout;
		vResizing: #shrinkWrap;
		hResizing: #spaceFill;
		extent: 400 at 300.
	
	w := TextMorph new contentsWrapped: 'Some very very very very long 
string...'.
	w
		"width: 300;"
		backgroundColor: Color veryLightGray;
		hResizing: #spaceFill.

	parent
		addMorphBack: (Morph new color: Color red);
		addMorphBack: w;
		addMorphBack: (Morph new color: Color blue).
	parent openInWorld.

	"w layoutChanged."

But doing 'w layoutChanged' afterwards everything is fine again. It has 
something to do with the default extent of the TextMorph. If you're 
uncommenting the width-line there will be less space below the TextMorph. 
Also, everything if fine without the hReszing:#spaceFill of the TextMorph...

How to get it right from the beginning on? Without doing explicitly 'w 
layoutChanged'.

Best regards,
   r2ruyu



More information about the Squeak-dev mailing list