[Morphic] About worlds

Joshua 'Schwa' Gargus schwa at cc.gatech.edu
Sat Aug 16 18:04:48 UTC 2003


On Sat, Aug 16, 2003 at 08:38:08PM +0300, Daniel Vainsencher wrote:
> Andreas Raab <andreas.raab at gmx.de> wrote:
> > Hi,
> > 
> > > Andreas Raab <andreas.raab at gmx.de> wrote: 
> > > I understand the problem, but you're implicit about the solution - do
> > > you mean that instead of todays remove we would change the 
> > > Morphs parent to be the world?
> > 
> > No, what I'm saying is that the "owner" relationship should not be affected
> > at all when you "remove" a morph.
> Ah. It seems to me though we can keep the invariant you describe below
> (isParent(A,B) iff isSubmorph(B,A)) and still solve the problem. What do
> you think about fixing the issue the way I propose - every Morph always
> starts out with a parent (AstralWorld? WombWorld?), and can only change
> parents, but never remains orphaned. AFAICT, this would not change many
> implementation issues, but would require eventually changing the
> interfaces so that the remove would be replaced with #reParentTo: or
> something like it.

I think that Andreas is proposing doing away with this invariant, or making
it one-directional:

(isSubmorph(B,A)) implies (isParent(A,B)), but not vice-versa.  That way,
a morph can always find its world by traversing up the owner chain, but
morphs that have been "closed" will not be drawn, receive mouse events, etc.

Joshua

> 
> > Secondly, there is a significant problem when creating new morphs. These
> > days, new morphs are not initialized in a definitive context (e.g., when
> > they are created their owner is nil) and one would need to provide
> > appropriate initializations. Most places don't care about this at all and I
> > would suspect that we'd get into serious trouble if we started relying on
> > all morphs being properly initialized ("properly" as in: having a definite
> > link to some world unless destroyed).
> 
> How much more complex is it than adding owner _ WombWorld to
> Morph>>initialize? seems to make things simpler in that stuff is always
> initialized, except that initially it is to a world that isn't shown...
> 
> Anyway, regardless of what solution is chosen, it doesn't seem to me like 
> something that's impossible to do in 3.7 or 3.8...
> 
> Ok, will pipe down and let the experts talk now...
> 
> Daniel



More information about the Squeak-dev mailing list