[Q][morphic] LayoutPolicy and LayoutFrame

Ned Konz ned at bike-nomad.com
Sat Apr 27 21:25:15 UTC 2002


On Saturday 27 April 2002 01:09 pm, Martin Drautzburg wrote:
> Ned Konz <ned at bike-nomad.com> writes:
> > You can just turn on TableLayout and set the layoutInset
> >
> > self layoutPolicy: TableLayout new.
> > self addMorph: otherMorph.
> > self layoutInset: 10 at 10.
> > self layoutChanged.
>
> This does not resize the otherMorph. TableLayout just does not do
> this, right ?

Well, I omitted the 

otherMorph vResizing: #spaceFill; hResizing: #spaceFill

> > self addMorph: otherMorph
> >   fullFrame: (LayoutFrame
> >     fractions: (0 at 0 corner: 1 at 1)
> >     offsets: (10 at 10 corner: -10 at -10))
>
> That looks nicer. Still: if I want the otherMorph's size to follow
> its parent size, do I always need a LayoutFrame ? I sort of don't
> understand why TableLayout can live without one and
> ProportionalLayout cannot.

Because TableLayout figures out the layout frames on its own. One 
(TableLayout) is automatic, ProportionalLayout is manual.

> BTW: What's the difference between fullFrame: and layoutFrame:

#addMorph:fullFrame: takes a Morph and a LayoutFrame and is a message 
to the parent;

#layoutFrame: tells the child what its layout frame is.

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE




More information about the Squeak-dev mailing list