Generating source code from Morphs [was: RE: More Widgets for Squ eak....]

Chris Reuter cgreuter at calum.csclub.uwaterloo.ca
Wed Feb 2 04:45:42 UTC 2000


On Tue, Feb 01, 2000 at 12:49:17PM -0500, Norton, Chris wrote:
> Hi Lex & Company.
> 
> On February 01, 2000, Lex Spoon [lex at cc.gatech.edu] wrote:
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> "Sort of.  Morphic is nice in that you can drag things around and embed them
> in each other.  Using this facility plus inspectors, you can create an
> arbitrary window this way.  It pretty much has the feel of a GUI builder,
> except there is no way to generate code to recreate the thing."
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> You know, I have often wished that this mechanism were more robust, as it is
> much easier to drag-n-drop widgets together than it is to wire them up the
> old fashioned way.  Perhaps the top level morph should have a standard
> selector that can generate a method definition that can later be used to
> rebuild the whole thing programmatically.  Thus you could hook morphs
> together, embed them into a SystemWindow or playfield and then ask the
> SystemWindow to generate code that can reproduce the whole mess...  I
> suppose the first thing to do is to implement Morph>>asSourceCode. Or
> something like it.

I've written something along those lines already.  I've got a
collection of about 10 morphs that support a common protocol to create
source code that recreates the layout.  They're also fully pluggable
and provide a simple API so that you can use them without having to
understand their internals.

I'm in the process of cleaning up the code right now.  I was planning
on releasing it in a couple of weeks, but if anyone's interested in
playing with what I have now, send me email.  


			      --Chris






More information about the Squeak-dev mailing list