[Cuis-dev] Talking about Layouts

Dan Norton dnorton at mindspring.com
Tue Apr 28 07:04:16 PDT 2020


On Tue, 28 Apr 2020 13:05:28 +0200
Hilaire Fernandes via Cuis-dev <cuis-dev at lists.cuis.st> wrote:

> Comment in text.
> 
> Le 26/04/2020 à 23:46, ken.dickey--- via Cuis-dev a écrit :
> > I think we have a user interface problem with   
> > LayoutSpec>>minorDirectionPadding:  
> >
> > One is easily confused, so perhaps our descriptions are wrong -- we 
> > are talking badly.
> >
> > In particular, I would like to use "attraction" rather than
> > "padding", but see below.
> >
> > ===============================================
> >
> > I also propose a brief discussion in the Terse Guide.
> >
> > Perhaps something like:
> > =========================
> >
> > LayoutMorph's arrange subMorphs as either a horizontal Row or a 
> > vertical Column.
> >
> > Along this Major or Layout Axis, subMorphs may be attracted toward
> > one side (0.0) or the other (1.0) or anywhere in between.  
> 
> >
> > If a Row, one can specify the placement attraction symbolically as
> >   { #rowLeft (0.0), #center (0.5), #rowRight (1.0) }
> >
> > If a Column, one can specify the placement attraction symbolically
> > as: { #colTop (0.0), #center (0.5), #colBottom (1.0) }
> >
> > A LayoutMorph may also have a Morph Separation specified as x at y
> >
> > ======
> >
> > Each subMorph of a LayoutMorph may have an optional LayoutSpec
> > which the subMorph uses to indicate how that Morph  wants to be
> > arranged by its containing LayoutMorph.
> >
> > Options include treating the Morph's width and height as fixed or 
> > proportional to the LayoutMorph's extent.  
> 
> 
> What about "Minor or Perpendicular axis/direction" ?
> >
> > A LayoutSpec may also indicate an attraction along the *Minor or 
> > Contrary Axis. *
> >
> > Again, symbols may be used.
> >
> > If in a LayoutMorph Row: { #rowTop (0.0), #center (0.5), #rowBottom 
> > (1.0)}
> >
> > If in a LayoutMorph Column: { #colLeft (0.0), #center (0.5),
> > #colRight (1.0) }
> >
> > =============================================================
> >
> > I propose we change the access methods
> >   LayoutMorph>>padding: --> LayoutMorph>>attraction:
> >   LayoutSpec>>minorDirectionPadding: --> LayoutSpec>>attraction:
> >
> > And use the symbols as above in place of {#right, #top, #left,
> > #bottom}.  
> 
> Symbol is nice I guess.
> 
> Is it wise to propose to the user understanding two messages with the 
> same name but a bit different behavior?
> 

It would be better to make the names different IMO.

> May be the second one could be make more explicit as minorAttraction: 
> perpendicualAttraction:, alternateAttraction:. ...
> 

Maybe LayoutSpec>>orthogonalAttractional ?

> Which of padding or attraction is the most well known term in GUI 
> construction? It could help to decide.
> 
> Hilaire
> 



More information about the Cuis-dev mailing list