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

Sean P. DeNigris sean at clipperadams.com
Sun Aug 14 19:57:02 UTC 2011

r2ruyu-nana wrote:
> isn't there a way to make TextMorph behave like an ordinary Morph
> concerning hResizing:#spaceFill?

That's what your first try was doing. The TextMorph was exhibiting the
regular #spaceFill behavior, namely filling the entire horizontal space.

I'm not sure what you're asking, but if you mean "how do I get a margin
between the outer edge of the parent morph and the TextMorph?" there are two
options I can think of:
1) The easy one: add "layoutInset: 20" to the cascade after "extent:
400 at 300", which will put a margin around all the submorphs (not just the
2) More involved, but more flexible: put the TextMorph inside a morph with
hResizing: #spaceFill and layoutPolicy: ProportionalLayout new. Then you can
have fine-grained control over the space on all sides of the TextMorph e.g.
margin only on the right, etc.

There are some good examples that you can execute on the Swiki. Google "how
to layout submorphs".


View this message in context: http://forum.world.st/TextMorph-takes-to-much-space-in-layout-tp3741528p3743411.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.

More information about the Squeak-dev mailing list