[Q][morphic] LayoutPolicy and LayoutFrame

Ned Konz ned at bike-nomad.com
Sat Apr 27 18:34:04 UTC 2002


On Saturday 27 April 2002 10:10 am, Martin Drautzburg wrote:
> I just found out how to lay out submorphs using layoutFrame and
> LayoutPolicy.
>
> If all I want is a submorph that is inset by a number of pixels and
> whose size follows the size of its owner, do i still need a
> LayoutFrame or is there an easier way ?

You can just turn on TableLayout and set the layoutInset

self layoutPolicy: TableLayout new.
self addMorph: otherMorph.
self layoutInset: 10 at 10.
self layoutChanged.

> I sortof don't know where to send the methods I sent to
> LayoutFrame, you know this kind of stuff:
> (topOffset:10; bottomOffset: -10; leftOffset:10; rightOffset: -10;
> topFraction:0; bottomFraction:1; leftFraction:0; rightFraction:1.)

self addMorph: otherMorph
  fullFrame: (LayoutFrame
    fractions: (0 at 0 corner: 1 at 1)
    offsets: (10 at 10 corner: -10 at -10))

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




More information about the Squeak-dev mailing list