Moprhic Questions (was Re: Strangeness with AcceptableCleanTextMorph?)

Matt Rosen rosen at sjdccd.cc.ca.us
Mon Sep 28 16:36:19 UTC 1998


Mark Guzdial wrote:

> I ended up with a lot of questions.  If anyone here can lend a hand, I'd
> appreciate it!

I have written a couple of morphic applications also, the biggest being a
collaborative writing tool with hooks to commercial Smalltalk for persistence
storage in a database.  Students use a text editing tool to edit, format, stylize
and ultimately submit essays.  Other students can then use a reviewing tool to
highlight passages and add annotations to praise or suggest improvement areas.
The original submitter can then review these comments to submit a revised essay
with changes highlighted.

The environment has been fantastic so far, and we are very excited about giving
students a good tool at no cost that will run on whatever platform they have
available.  We will be trying out the user interface and doing a pilot essay
assignment with our Internet "Freshman English" students next month.

I have found that creating morphic applications currently is easiest using a
browser and writing the basic code until I have some components that I can then
assemble morph style.  The scripting environment, to me, shows alot of promise
and is very exciting, but needs "critical mass" yet.  It could well be that I
haven't made the mental shift from my code browser mentality, though...

> - Is there a way to stick a StringMorph-like object (i.e., a non-editable
> text) into a SystemWindow?

I'm not sure I understand your question.

> - Is there a way to get text with a scroll bar inside a RectangleMorph or
> a PlayField?

I use a PluggableTextMorph.

> - Is there a way to get TextMorphs to resize with a RectangleMorph or
> PlayField?  I did get a TextMorph to fit the "owning" RectangleMorph, but I
> couldn't get the RectangleMorph to resize when I put it into another
> RectangleMorph or PlayField.

You may want to use the specialized case of a Rectangle Morph, the PasteUpMorph,
which has the ability to resize to fit its owning morph.  I use that in my own
application for this purpose.

> - What's the advantage of making a morph into its own subclass?  It just
> creates a class definition, right?  Is there anyway to assemble a morph
> then somehow turn it into an openAsMorph method so that I can make many of
> them?

I think that the same advantages exist as for any subclassing design.  You can
override inherited behaviors, for one thing.  Actions seem to ultimately be
methods that belong to a special protocol for organizational reasons and for
controlling exposure of certain groups of behaviors to the user as scripter (as
opposed to the user as toolsmith).  I think I see where this is heading, though I
would love to hear from the more knowledgable in the community.

> - What's the advantage of naming the components?  Does it interact somehow
> with making its own subclass?

It looks as if naming a component will make more sense as the scripting
environment becomes more mature.  After all, you will need some unique way to
refer to morphs of the same kind within a script.  There is a structure involving
"players" as a type of model, "costumes" for holding morphs as view/controllers,
and "slots" for establishing other relationships (named relationships being one
type?) between application objects at the user scripting level.  I don't think I
fully understand the full intent of the naming scheme, however.

> - What does it mean for something to be "sticky"?

Morphs which move around the playfield when you drag them with the mouse can be
made sticky.  They will stay put when you drag them unless you "grab" them using
a menu or appropriate halo circle.

> Thank you!
>  Mark

Hope it helps.  I am happy to share application code if it would be helpful,
though it may prove more harmful if I don't "get it" yet.  Part of the fun is not
knowing if you are doing things the "right" way or not, I guess.

Happy Morphing!

Matt Rosen
San Joaquin Delta College





More information about the Squeak-dev mailing list