I have found the following example to not work as expected. The problem seems to come from the wrapDirection.
In this exemple if you resize the morph, the layout is refresh correctly.
I badly need it to work as expected
submorph := Morph new color: Color red; layoutPolicy: TableLayout new; listDirection: #leftToRight; cellInset: 10; vResizing: #shrinkWrap; hResizing: #spaceFill; wrapDirection: #topToBottom. 10 timesRepeat: [submorph addMorph: Morph new]. (Morph new color: Color yellow; extent: 300@500; layoutPolicy: TableLayout new; listDirection: #topToBottom; layoutInset: 10; cellInset: 10; addMorphBack: submorph; addMorphBack: (Morph new color: Color orange; vResizing: #spaceFill; hResizing: #spaceFill)) openInWorld
Hilaire Fernandes skrev:
I have found the following example to not work as expected. The problem seems to come from the wrapDirection.
In this exemple if you resize the morph, the layout is refresh correctly.
I badly need it to work as expected
submorph := Morph new color: Color red; layoutPolicy: TableLayout new; listDirection: #leftToRight; cellInset: 10; vResizing: #shrinkWrap; hResizing: #spaceFill; wrapDirection: #topToBottom. 10 timesRepeat: [submorph addMorph: Morph new]. (Morph new color: Color yellow; extent: 300@500; layoutPolicy: TableLayout new; listDirection: #topToBottom; layoutInset: 10; cellInset: 10; addMorphBack: submorph; addMorphBack: (Morph new color: Color orange; vResizing: #spaceFill; hResizing: #spaceFill)) openInWorld
Here is a hack. I think there could be an issue with lazy initiallization in some layout routine that must forced trough a draw before it works... submorph := Morph new color: Color red; layoutPolicy: TableLayout new; listDirection: #leftToRight; cellInset: 10; vResizing: #shrinkWrap; hResizing: #spaceFill; wrapDirection: #topToBottom. 10 timesRepeat: [submorph addMorph: Morph new]. morph_ Morph new openInWorld. morph color: Color yellow; extent: 300@500; layoutPolicy: TableLayout new; listDirection: #topToBottom; layoutInset: 10; cellInset: 10; addMorphBack: submorph. morph addMorphBack: (Morph new color: Color orange; vResizing: #spaceFill; hResizing: #spaceFill). World doOneCycle. morph layoutChanged.
karl
Hilaire Fernandes a écrit :
I will try to apply your hack to my situation.
Thanks
Hilaire
karl a écrit :
Here is a hack. I think there could be an issue with lazy initiallization in some layout routine that must forced trough a draw before it works...
The "World doOnCycle" can do some miracle, thanks for the tip. However it forces to do some tricks in the code.
Hilaire
squeak-dev@lists.squeakfoundation.org