[squeak-dev] Weird Morphic layout problem
karl ramberg
karlramberg at gmail.com
Fri Jan 7 17:01:52 UTC 2011
If you can fix this you get a star in my book ;-)
Some layout issues seem to not "register" untill the morph is opened in the
world. Some issues not even then.
Karl
On Fri, Jan 7, 2011 at 2:57 AM, Sean P. DeNigris <sean at clipperadams.com>wrote:
>
> I have MyMorph (TableLayout, h/v resizing: #shrinkWrap)
> with a submorph (TableLayout new, hResizing: #spaceFill, vResizing:
> #shrinkWrap)
> whose submorphs are TextMorphs (hResizing: #spaceFill)
>
> I can't get the TextMorphs laid out properly. I want them to fill the
> horizontal space of the owner morph, but be packed vertically together with
> no space. However, TextMorph's with lines that wrap overlap the text of
> the
> TextMorph directly below them.
>
> The weird thing is that everything gets laid out properly if I edit any of
> the TextMorphs. I tried calling #layoutChanged on various morphs with no
> effect.
>
> Thanks.
> Sean
>
> DoIt the following to see what I mean:
> "aMorph := Morph new
> layoutPolicy: TableLayout new;
> layoutInset: 100;
> cellInset: 20;
> hResizing: #shrinkWrap;
> vResizing: #shrinkWrap;
> cellPositioning: #topLeft.
>
> titleMorph := Morph new
> layoutPolicy: TableLayout new;
> hResizing: #spaceFill;
> cellPositioning: #topLeft.
> titleMorph addMorphBack: 'a line that the enclosing morph will
> shrink
> around' asMorph.
> aMorph addMorphBack: titleMorph.
>
> listMorph := Morph new
> color: Color green;
> layoutPolicy: TableLayout new;
> hResizing: #spaceFill;
> vResizing: #shrinkWrap;
> cellPositioning: #topLeft.
> aMorph addMorphBack: listMorph.
>
> itemMorph := TextMorph new
> hResizing: #spaceFill;
> vResizing: #shrinkWrap;
> contents: 'a line that is so long that it wraps to the next line.
> there is
> a lot of information here, so the line is long.';
> wrapFlag: true.
> listMorph addMorphBack: itemMorph.
>
> item2Morph := TextMorph new
> hResizing: #spaceFill;
> vResizing: #shrinkWrap;
> contents: 'a short line that will get trampled';
> wrapFlag: true.
> listMorph addMorphBack: item2Morph.
>
> aMorph openInWorld."
>
> --
> View this message in context:
> http://forum.world.st/Weird-Morphic-layout-problem-tp3178526p3178526.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20110107/083de84a/attachment.htm
More information about the Squeak-dev
mailing list
|