Balloon Issues

Lex Spoon lex at cc.gatech.edu
Wed Jan 12 20:10:11 UTC 2005


> > That would be great. I presume existing Morph subclasses would work, 
> > or do they need to be rewritten?
> >
> Most of Morphic works with alternate Canvases (as evidenced by the 
> Postscript output code). I actually had a DPS Canvas back then that 
> would use NeXT's DisplayPostscript for drawing to screen. It mostly 
> worked: the UI drew, I could create morphs and move them around etc. 
> The biggest difficulty was text, which at that time bypassed the Canvas 
> API and drew the strike fonts directly on the underlying Form, causing 
> all sorts of headaches.
> 

There's also RemoteCanvas, which is what is used when people share
screens across the network (ie, when they are using Nebraska).  In order
to deal with text issue, I put in something called
CanvasCharacterScanner, which takes a paragraph command and breaks it
down into a bunch of individual drawString commands.  This would be
useful in the implementation of any alternate canvas, and maybe it
should even be the default implementation in class Canvas.  The
"paragraph" method in Canvas is by far the most complicated one to
implement, and it doesn't really need to be there.  It's only there, I
think, because someone wanted to quickly re-use the draw-on-form code
from MVC.  That's not needed now that there is CanvasCharacterScanner.

Note, by the way, that "Balloon" is more than the Canvas abstraction
that most of Morphic limits itself to.  Balloon is a more general API
that is used, for example, by the Flash renderer.  Sadly, if you try to
draw onto a RemoteCanvas a Morph that wants Balloon functionality, you
get a pink debug window... and there is such a morph in the default
project of the initial Squeak download image!


-Lex



More information about the Squeak-dev mailing list