[Q][morphic] LayoutPolicy and LayoutFrame
Hannes Hirzel
hannes.hirzel.squeaklist at bluewin.ch
Sat Apr 27 22:49:54 UTC 2002
Ned Konz <ned at bike-nomad.com> wrote:
> 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.
>
Martin,
A suggestion: perhaps you might your example (with some elaboration)
to the examples page on
http://minnow.cc.gatech.edu/squeak/2141 How to lay out submorphs
I think many people would be interested having this documented.
On the same page is a link to an active essay by Andreas Raab of
which you are probably already aware of.
Regards
Hannes
More information about the Squeak-dev
mailing list
|