World sensitivity (was Re: [updates] 35 more for 2.8alpha)

Raab, Andreas Andreas.Raab at disney.com
Sun Apr 30 18:54:45 UTC 2000


> On Sun, 30 Apr 2000 20:13:23 +0200 Stefan Matthias Aust 
> <sma at 3plus4.de> wrote:
> >Actually, I think it isn't needed.  It's a handy reference but every
> >morph can be asked for its world by using #world already.  
> 
> Assuming that morph is in the world already.

Every Morph originates (one way or another) from some other Morph so there's
always some Morph you can ask about it's world. Except from the first one
(e.g., when you create a Morphic project or a Morphic window in MVC) in
which case the world needs to be explicitly created anyways (and notice that
World>>owner == nil, so that myWorld openInWorld: nil should be just fine).
Actually I think that *any* Morph with owner == nil should behave as if it
defines its own world.

> That's a good idea, but it still leaves the question of where 
> those few methods will find the world. Object>>currentWorld starts out:
> 
> 	World ifNotNil: [^ World].

Object>>currentWorld is nothing but a convenient shortcut. Those methods
should get passed the world explicitly (or the classes should just have an
instVar currentWorld if passing the world is to inconvenient otherwise).

  - Andreas





More information about the Squeak-dev mailing list