[ENH] MorphGeometryTweaks-efc

tblanchard at mac.com tblanchard at mac.com
Mon Feb 17 12:32:32 UTC 2003

On Monday, February 17, 2003, at 10:44  AM, goran.hultgren at bluefish.se 

> Ned Konz <ned at bike-nomad.com> wrote:
>> On Thursday 13 February 2003 07:10 pm, Nevin Pratt wrote:
>>> I support Todd by saying that the Geomery management metaphore that
>>> the Interface Builder for NeXT used (and now Apple uses) really is
>>> the best I've ever seen for any GUI builder.


> Personally I think that of all the schemes I have seen (boxes like TeX,
> struts/springs like Galaxy and others, relative as in VW, etc) I must
> say that the one I liked best was the one in VisualAge Smalltalk where
> each of the four edges of any component could be related to any other
> edge in the composition using either a strut or a few other relations 
> if
> my memory serves.
> Another developer independently ended up implementing this model in a
> very large Java project I worked in, and called it AttachmentLayout.
> I guess it is similar to strings/struts but with (don't know about 
> NeXT)
> the possible difference that the relations where orthogonal to the
> composition structure (parent/child) IIRC - is it like that in NeXT 
> too?

The model in NextStep relates everything to the immediate parent.
What I like about it is that its *intuitive*.  I pop up the inspector 
on the widget and its immediately apparent to me what will happen when 
I stretch the window.  There is a strut or spring on each side and one 
internal. The internal controls whether the component grows at all.  
The outer ones on either side determine what edge the widget tracks.


strut | strut | spring

This is like having no layout at all - the component retains its size 
and remains fixed relative to the upper left corner.

strut | spring | strut means the control stretches and the edges stay a 
fixed distance from its container edges - this is perfect for a text 

spring | strut | strut gets you a something rigid and adhering to the 
right edge.

About the only thing you can't do with this is grid layouts - which 
could be its own component or layout manager.

I contrast this with the current layouts in morphic - which I can't 
figure out no matter how I play with them.  The options are cryptic and 
I still don't understand how to do  what I want after playing with them 
for half an hour.

I've finished a struts and springs layout control and extended layout 
properties.  I'll probably have something to show in a few days.  I do 
have to say that adding a new layout requires touching an awful lot 
more code than I think it should.

-Todd Blanchard

More information about the Squeak-dev mailing list