[Cuis-dev] LayoutMorph and offAxisEdgeWeight

Juan Vuletich juan at cuis.st
Mon Aug 12 06:29:51 PDT 2024


On 8/4/2024 6:16 PM, 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.
>
> -- 
> R. Mark Volkmann
> Object Computing, Inc.

What you want is:

lm := LayoutMorph newColumn.
lm separation: 10.
b1 := LabelMorph new contents: 'short'; color: Color white.
b1 layoutSpec offAxisEdgeWeight: 0.
lm addMorph: b1.
b2 := LabelMorph new contents: 'very long'; color: Color white.
b2 layoutSpec offAxisEdgeWeight: 0.
lm addMorph: b2.
lm openInWorld.

The off-axis wheight is a property of the submorph layoutSpec. Not of 
the outer LayoutMorph. See `LayoutMorph example2`.

BTW, play with, read the code, hack the code around. Do this with all 
the LayoutMorph class side examples. They are there to help you.

Cheers,

-- 
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240812/a42ea1a4/attachment-0001.htm>


More information about the Cuis-dev mailing list