On Monday 19 Jan 2009 6:27:55 pm Mark Carter wrote: > Is it rare for people to create morphs anyway, or is it something that > people like doing all the time? It depends on how lazy a programmer is :-). The existing collection of Morph is quite extensive, so you could get by most of the time by making small extensions to an existing morph class.
> One thing that's puzzling me somewhat is that if I take something like a > RectangleMorph, it has both a class definition, and a widget that I can > drag onto my desktop. If I create my own morph graphically, then it has no > class definition associated with it. I'm confused: if I set out to define a > class, then how comes I don't have to specify the sub-components > programmatically, and conversely, if I create my own morph visually, then > how does it get a class? It has to do with Morph and Etoys. Etoy is a "Player" associated with a morph that handles a vocabulary of visual protocols (e.g. tiles for attributes and commands) for programming. The widget that you dragged is an instance of RectangleMorph with a nil player. If you attempt to open its viewer (eye icon), it is automatically associated with an instance of Player class and is called an Etoy. You can now program its behavior visually in addition to textual code. This is all a gross simplification of what happens under the hood. > I have looked around for tutorials on creating morphs, but I don't seem to > find any simple examples where it says "look, this is the proper way you > design UI elements". A good starter article for Morphic is http://stephane.ducasse.free.fr/FreeBooks/CollectiveNBlueBook/morphic.final.pdf HTH .. Subbu _______________________________________________ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners