[Cuis-dev] LayoutMorph and offAxisEdgeWeight

ken.dickey at whidbey.com ken.dickey at whidbey.com
Sun Aug 4 15:35:23 PDT 2024


On 2024-08-04 14:16, Mark Volkmann via Cuis-dev wrote:

> I ran this code in a Workspace:
> 
> lm := LayoutMorph newColumn.
> lm separation: 10.
> lm layoutSpec offAxisEdgeWeight: 0.
> lm addMorph: (LabelMorph new contents: 'short'; color: Color white).
> lm addMorph: (LabelMorph new contents: 'very long'; color: Color 
> white).
> lm openInWorld.
> 
> The attached screenshot shows what I get and includes the LayoutSpec.
> It looks like I successfully set the `offAxisEdgeWeight` to zero, so I 
> expected the two `LabelMorph` instances to be left-aligned inside the 
> `LayoutMorph`, but they are centered.
> I must be misunderstanding how `offAxisEdgeWeight` works.

Each submorph of a LayoutMorph can have a LayoutSpec that informs their 
containing LayoutMorph where they want to be on the off/cross axis.  Set 
LayoutSpecs for the Morphs you are adding to the LayoutMorph to see 
this.

Setting the LayoutSpec of the containing LayoutMorph is only significant 
if it is contained within another LayoutMorph.

https://github.com/Cuis-Smalltalk/Learning-Cuis/blob/master/LayoutTour.md

HTH,
-KenD
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2024-08-04 at 4.14.00?PM.png
Type: image/png
Size: 71401 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240804/234a5ce8/attachment-0001.png>


More information about the Cuis-dev mailing list