Morphic question

Ned Konz ned at bike-nomad.com
Mon Feb 10 17:34:34 UTC 2003


On Monday 10 February 2003 12:00 am, Dustin Sallings wrote:
> I went through some of the morphic tutorials and I think I
> understand the basic concepts.  What I didn't get was the part
> where you create a morph class that will contain one or more
> embeded morph classes.
>
> 	I can instantiate them in a project and get them all embeded and
> all that, but I'd like to create a standalone morph of which I can
> easily create multiple instances.

I'm not sure exactly what you want to do, but that never stops me from 
responding <g>.

If you mean "I've written my own Morph class with a constructor and I 
want to make it available in the environment for direct manipulation 
by users", there's a few hooks for this.

* Flaps: You can make new flaps and put your own Morphs into them. 
When you drag a Morph out it will be duplicated

* The Objects Tool (Cmd-O): if you add a class side method 
#descriptionForPartsBin (browse implementors) you will appear in this 
tabbed object creation tool. This method returns a description of how 
to create and present a new morph. If you want several different 
entries in the Objects Tool, you can use 
#supplementaryPartsDescriptions.

* The (classic) New Morph menu: if you make the class side method 
#includeInNewMorphMenu return true, you will find your Morph in this 
alphabetical menu

* Construction from browsers (via the "sample instance" menu choice): 
the class side methods #newStandAlone and #initializedInstance (which 
calls #newStandAlone if you have a #descriptionForPartsBin)

If you mean "I can create a Morph by direct manipulation but want it 
to be available in code", you need to code the steps you used to 
create it manually (perhaps in a subclass of some Morph).

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE



More information about the Squeak-dev mailing list