[Q] fullBounds and Bounds in Morphic

Bob Arning arning at charm.net
Wed Dec 29 12:49:26 UTC 1999


On Tue, 28 Dec 1999 22:59:08 -0800 "Andrew P. Black" <apb at cse.ogi.edu> wrote:
>I'm trying to build a control panel.  The Morphic containment 
>hierarchy looks like the following (extracted by playing with an 
>explorer)
>
>  aSystemWindow (fullBounds =  263 at 340 corner: 863 at 712)
>	aScrollPane (fullBounds = 264 at 357 corner: 863 at 711)
>		aTransformMorph (fullBounds 267 at 345 corner: 849 at 697)
>			anAlignmentMorph (fullBounds 0 at 0 corner: 320 at 61)
>
>and the AllignmentMorphs contains more stuff which looks as I expect. 
>What I don't expect is that the enclosing objects (ATransformMorph 
>and outwards) have bounds that are so much bigger than the enclosed 
>AlignmentMorph.  I don't give any of these objects explicit sizes, 
>and I would expect them to re-size around the AllignmentMorph that 
>they contain. 
[snip]
>What am I doing wrong?  As the comment indicates, I stole a lot of 
>this from Preferences class, where it seems to work just fine.

The driving force here is the SystemWindow which has been told to be a certain size and adjusts its suppanes (the ScrollPane) accordingly. How it got told (and something you didn't copy from Preferences) is via #initialExtent. If you add:
=========
!AccessorPreferences methodsFor: 'as yet unclassified' stamp: 'RAA 12/29/1999 07:18'!
initialExtent

	^330 at 200! !
=========
then you will get more of the behavior you expect.


>If there is anything written on how bounds and fullBounds interact, I 
>would appreciate a pointer.

I'm not sure what you mean by interact, but the simple difference is this: 
- bounds is the rectangle enclosing a morph 
- fullBounds is generally the rectangle enclosing the morph PLUS all its submorphs. Some morphs (those related to scrolling, e.g.) apply clipping and ignore anything outside their own bounds so they will implement this a bit differently. Hope this is what you were asking.

Cheers,
Bob





More information about the Squeak-dev mailing list