Layout question

Ned Konz ned at
Wed Feb 12 20:19:27 UTC 2003

On Wednesday 12 February 2003 12:05 pm, Torsten Sadowski wrote:
> could someone please explain to me how the xScrollBar in a
> TwoWayScrollPane knows how to put itself on the bottom? I would
> like to add a WheelMorph just left of the Scrollbar but I could not
> find out how to put a fixed size Morph to the right or on the
> bottom of a resizeable Morph with the TableLayout (which is still a
> closed book to me). I did play around with TKinter and Python and
> found the layout there much easier to design but maybe I just
> didn't understand the TableLayout concept.

I wouldn't use TableLayout for this; I'd use ProportionalLayout. You 
give specs that can position a submorph relative to its parent. Or 
I'd just do it like TwoWayScrollPane does it, by just doing the 
layout "manually". You can also override doLayoutIn: for this kind of 

Anyway, the ScrollBar just looks at its bounds to determine that it's 

	^ bounds isWide
		ifTrue: [11 @ self innerBounds height]
		ifFalse: [self innerBounds width @ 11]

And the scroll pane doesn't use a layout manager. It just does this:

	"used to handle left vs right scrollbar"
	yScrollBar bounds: (bounds topLeft extent: 16 @ (bounds height - 
	xScrollBar bounds: ((bounds left + 16) @ (bounds bottom - 16)  
extent: (bounds width - 16) @ 16).

Ned Konz

More information about the Squeak-dev mailing list