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

Raab, Andreas Andreas.Raab at disney.com
Sun Apr 30 19:59:18 UTC 2000


> I not sure what you you mean by "originates" here. There are 
> quite a few places in the current image that say something like:
> 
> 	SomeMorph new openInWorld
> 
> What Morph is this originating from? Take the case of the 
> Compiler doing a fileIn and encountering a syntax error. It 
> currently opens a SyntaxError appropriate to the Morphic/MVC 
> environment in which it finds itself. Are you suggesting that 
> the Compiler be given a reference to the world prior to 
> starting the fileIn?

Actually yes. At least there needs to be some context in which the action is
executed. E.g., assume you want to have a remote 'error world' into which
errors get logged so that some (remote) user can examine these. This is
*not* your current World and while it seems reasonable to open up the error
in the current world I can think of all sorts of cases where you really want
to open up something in a world which is not current. And that does require
you to establish the context and cleans up the default 'currentWorld' use.

> Suppose I want my email client to tell 
> me when mail is received. Where does it perform this 
> notification? My preference would be that it notify me in 
> whatever world is currently active, but how could it know 
> that beforehand?

Good point. I think I was more arguing against the use of World for
designated receivers (e.g., everything that doesn't quite work in
Telemorphic) as well as the 'oh-so-convient' shortcut for determining what
GUI is currently primary. E.g., most methods I've seen use World along the
lines of

	World ifNil:[self doSomeMVCStuff]. "We can't do that in MVC"

which may be not quite accurate since there is quite a chance of having a
Morphic window in MVC open. In particular I don't like those

SomeClass>>openInWorld
	World ifNil:[self openInMVC]
	...

(or vice versa) methods.

> I can imagine Morphs that may want to delete themselves from 
> the world and then reappear later. Not in their own world, 
> but in whatever world the user is looking at. Additionally, a 
> Morph might want to adapt itself in some way to the world 
> *before* it is opened in that world.

Oh but that's okay - it can always do this through #openInWorld: aWorld
which should be the message sent once the world has been determined (by
whatever means).

  - Andreas





More information about the Squeak-dev mailing list