[Q] [Morphic] SystemWindow

tblanchard at mac.com tblanchard at mac.com
Mon Mar 10 03:08:08 UTC 2003


On Sunday, March 9, 2003, at 03:02  PM, Stephane Ducasse wrote:
> I wish you will produce something simple.

Yeah, me too.  Attempting to work on Morph seems to be like trying to 
do brain surgery on yourself with a mirror.  Its very easy to end up in 
the emergency evaluator (not too bad) or with a frozen image (not too 
good).

That mail message was written a couple days ago (I'm back in the US and 
living with mom for the time being while I find a job somewhere.  So 
I'm getting internet access about every other day when I go to this 
internet cafe).

Since I wrote that message, I've got ProtoMorph's layout working pretty 
well and have begun reimplementing some morphs on top of ProtoMorph.  
(Basically by copying the class and changing its superclass).  I play 
with it for awhile and see if it relies on any behavior not yet in 
ProtoMorph - if so I either remove the dependency on that code or 
decide it needs to be there.

Some stuff I've learned - much of Morphic's fragility is probably due 
to the use of fullBounds as a trigger to cause layout calculation and 
the cached value getting out of sync somewhere.  The accessing of 
fullBounds when it is nil is the trigger to relayout the submorphs.  I 
removed the layout trigger in fulllBounds and now do it immediately 
when extent: gets called and I've replaced fullBounds's implementation 
with a call to privateFullBounds and redrawing works much better.  I'll 
probably resume caching the calculation later when I know what I'm 
doing, but so far, every time I try it I end up with odd redraw 
behavior.

Protomorph does not use any of the existing layout code and I've added 
two other hooks for changing layout behavior.

> Todd I once read an interview (or may be this is in the chapter 
> written by dan for the blue book)
> in which he explains that the way submorph was layouted was 
> conceptually an error (it is relatiev and should have been absolute or 
> vice versa).

At the moment, all morphs have coordinates relative to the screen (ie 
absolute).  I can't say I particularly like it but I can't come up with 
a really compelling reason to change it either.

> Chris I think that the best way to help todd (I may be completely 
> worng)
> is not to write documentation but small scenario (eventually that we 
> could test) that document
> how to build simple and more complex system with newMorph.

That would be cool.  I can't think of a single layout scenario struts 
and springs doesn't handle intuitively apart from grid layout (which I 
think is kind of special and maybe should be a special morph - like 
graph paper or something).

-Todd Blanchard



More information about the Squeak-dev mailing list