help needed setting the initial size of a SystemWindow instance

Greg A. Woods woods at weird.com
Sat May 12 07:43:04 UTC 2001


[ On Friday, May 11, 2001 at 23:33:49 (-0700), Raab, Andreas wrote: ]
> Subject: RE: help needed setting the initial size of a SystemWindow instance
>
> Correct. Have a look at SystemWindow>>openInWorld: which assigns new bounds
> right before putting the window up in the world.

Oh, of course!  I should have looked further at RealEstateAgent>>
initialFrameFor:world: more closely, but I didn't realise Morph>>bounds:
would override any earlier SystemWindow>>extent:, but now of course I
see it does.

> One way of changing this
> behavior would be to implement
> SystemWindow>>openAsIsIn: aWorld
> 	"Open the receiver with its existing bounds in the given world"
> 	aWorld addMorph: self.
> 	self activate.
> 	aWorld startSteppingSubmorphsOf: self.
> 
> and - if you're as lazy as I am - implement
> 
> SystemWindow>>openAsIs
> 	^self openAsIsIn: self currentWorld.

Hmmm, yes....

And now of course now with your hint I finally can see that there's a
SystemWindow>>openInWorldExtent: method too!  :-) [[ which does work
just fine for me at the moment ]]

I suppose an openAsIs method would be even more generic though since
with it one could also choose one's own position position: as well as
one's own extent:.

> Dude - why don't you just copy that method from SystemWindow over to
> FITBM???? That's easy too (or is it too easy?! ;-)

Indeed that's easy too, though as I say I'm still re-familiarising my
C-addled brain with Smalltalk -- it's been nearly 15 years since my last
encounter!  ;-)

The message protocol for SystemWindow is stunningly large!  ;-)

I also have to wonder if it's wise from OO p.o.v. to expose the access
to currentWorld in that way, at least within the design of the Morphic
sub-classes.  I am, after all, using this example as my first step down
the road of learning how to "Do It Right!(tm)"  :-)

-- 
							Greg A. Woods

+1 416 218-0098      VE3TCP      <gwoods at acm.org>     <woods at robohack.ca>
Planix, Inc. <woods at planix.com>;   Secrets of the Weird <woods at weird.com>





More information about the Squeak-dev mailing list