AlignmentMorph obsolete so what do I use?

Ned Konz ned at bike-nomad.com
Mon Jul 8 15:16:18 UTC 2002


On Sunday 07 July 2002 03:39 pm, Jerome Chan wrote:
> When I resize a window, the button sizes all change. I don't want
> that to happen.

It doesn't have to. The framing rectangles have two parts:
* a part that is proportional to the window size
* a part that is a constant offset from that

So for instance, this code in ArchiveViewer>>createWindow makes a 
button bar that is always 44 pixels high, but whose width varies with 
the window width:

	buttonBar _ self createButtonBar.
	self addMorph: buttonBar
		fullFrame: (LayoutFrame fractions: (0 at 0 corner: 1.0 at 0.0) offsets: 
(0 at 0 corner: 0 at 44)).

	self minimumExtent: (buttonBar fullBounds width + 20) @ 230.

You could also have the width fixed if you wanted.

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




More information about the Squeak-dev mailing list