[Cuis-dev] Layout edgeWeight: how do you like this explanation?

ken.dickey at whidbey.com ken.dickey at whidbey.com
Wed Apr 29 16:26:12 PDT 2020


On 2020-04-29 21:07, Dan Norton via Cuis-dev wrote:
> Hi Ken,
> 
> Your draft inspires some wondering aloud :)

Great!

> On Tue, 28 Apr 2020 21:45:34 +0000
> "ken.dickey--- via Cuis-dev" <cuis-dev at lists.cuis.st> wrote:
> 
>> ===============================================
>>   Proposed brief discussion in the Terse Guide:
>> ===============================================
>> 
>> LayoutMorph's arrange subMorphs as either a horizontal Row or a
>> vertical Column.
> 
> A LayoutMorph arranges its submorphs in either a row or a column and is
> created by either:
> 
> x := LayoutMorph newRow.
> or
> x := LayoutMorph newColumn.

Good either way.  I did "horizontal Row" partly as a clue for 
non-English speakers.

>> Along this Major or Layout Axis, subMorphs may be attracted toward
>> one side (0.0) or the other (1.0).  This is the LayoutMorph's
>> axisEdgeWeight.
> 
> (Would it be worthwhile to not reveal the #(0.0 0.5 1.0) values which
> Morphic uses internally?)

Actually, the problem is the #symbols !  The weight goes from 0.0 to 
1.0.

If we don't expose the range, then do we hack the inspector to cover 
this up?

Better, I think, to explain this up front, as the user will see a 
number, not a symbol, in the inspector.

BTW, the metaphor I came up with is buoyancy.  One floats to the top 
with minimal weight (0.0) is neutrally buoyant at (0.5) and sink to the 
bottom at (1.0).  Just turn the metaphor sideways for the other 
direction.  ;^)

"Like an egg, but square".  ;^)

> Submorphs can have an optional specification (LayoutSpec) which causes
> them to be attracted to the left, center, or right of a row; or, the
> top, center, or bottom of a column. This is specified by the 
> parameters:
> 
> #rowLeft, #center, rowRight
> #columnTop, #center. #columnBottom
> 
> (What happens if a column LayoutMorph encounters #rowLeft, for
> example? Should the symbols be #leftOrTop, #center, #rightOrBottom,
> giving us three instead of six?)

This is the problem with hidden encodings.

My intent for LayoutMorphs is to check and disallow the 'wrong' 
direction.

Of course, #beRow changes things, but the numeric value is correct, so 
if we have explained things well there is no harm.

Until a LayoutSpec becomes a subMorph of a LayoutMorph, we can't check, 
as noted in my layout editors (jpeg attached).

Personally, I think that a disjunctive OR like LeftOrTop is a bit 
confusing, as in "Did you walk to school or take a lunch?".  But I am 
open to this if others find it less confusing than I do.

> Note that a LayoutSpec is effective only in a submorph of a
> LayoutMorph. It is ignored by other morphs.
> 
>> 
>> If a Row, one can specify this weight symbolically as
>>    { #rowLeft (0.0), #center (0.5), #rowRight (1.0)}
>> 
>> If a Column, one can specify the weight symbolically as:
>>    { #columnTop (0.0), #center (0.5), #columnBottom (1.0) }
>> 
>> A LayoutMorph may also have a Morph Separation specified: x at y
> 
> (Is this sent to the LayoutMorph or the LayoutSpec?)

To LayoutMorph (note again the LayoutMorphEditor).

> This concludes my hallucinations (for now).

Please have more.  Imagination is a wonderful thing.  I hope to work 
toward the best solution(s).

Thanks much!
-KenD
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LayoutEditors-Reduced.jpg
Type: image/jpeg
Size: 37962 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20200429/621ffcad/attachment-0001.jpg>


More information about the Cuis-dev mailing list