Getting a submorph to spaceFill

Lex Spoon lex at cc.gatech.edu
Thu Mar 25 20:54:53 UTC 2004


Ned Konz <ned at squeakland.org> wrote:
> As you've probably guessed, the initial layout doesn't send #extent: so your 
> morph doesn't get resized. Instead it gets sent #bounds:.
> 
> Rather than overriding #bounds: as well, a better way to do this might be to 
> check the form size at drawing time.
> 

Morph>>bounds: calls #extent:, however.  It sounds like something else
is going on.

Your code deals with the *form* size, not the morph size.  I was about
to whine about changing the size of a morph within a drawOn: method,
which sounds quite unstable.  How is Morphic supposed to cope, if a
morph is asked to draw itself but it changes its size along the way? 
But the code you post is changing the *form* size, not the size of the
morph.  And it is using "self extent" to find the size of the form, thus
suggesting that the morph is indeed getting set to the correct size.

So perhaps the morph was getting resized all along, but it just wasn't
drawing in its full area?


-Lex



More information about the Squeak-dev mailing list