Layout question

Ned Konz ned at bike-nomad.com
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 
thing.

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

buttonExtent
	^ 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:

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

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



More information about the Squeak-dev mailing list