[squeak-dev] Morphic - wrong extent after adding submorph?

Bernhard Pieber bernhard at pieber.com
Sat Jul 17 19:50:55 UTC 2021


Hi,

I would have expected that when I wrap a morph in another morph, which has resizing set to #shrinkWrap, that the wrapping morph should have the same extent as the wrapped morph. However, this seems not to be the case:

| stringMorph rowMorph |
stringMorph := 'Morphic is great' asMorph.

rowMorph := Morph new color: Color transparent;
	layoutPolicy: TableLayout new;
	listDirection: #leftToRight;
	hResizing: #shrinkWrap;
	vResizing: #shrinkWrap;
	yourself.
rowMorph addMorph: stringMorph.

{stringMorph extent. rowMorph extent}. {97 at 14 . 50 at 40}

I wonder if this is a bug? Or does one have to send a special message to a morph after adding submorphs to it?

Cheers,
Bernhard


More information about the Squeak-dev mailing list