Simple Morphs

Maloney johnm at wdi.disney.com
Mon Apr 27 18:08:08 UTC 1998


Re:
>Let us say that you create a Morphic World and add a SimpleButtonMorph and a
>TextMorph to it. How do you tell the SimpleButtonMorph to change the
>TextMorph's text? How do you refer to another Morph in a particular Morph's actions?

Buttons are parameterized with:
  a target object
  a selector to be sent
  an optional list of arguments for the message
  when to do the action (on mouse down,
    repeatedly while down, or on mouse up)

You can actually set all of these using menu commands. To
set the target, put the button over the desired target morph
and then use the "set target" menu command on the button.


Re:
>When you create a Morph using the Morph palette, must you subclass the
>instance of the Morph you have just created before modifying some of its code
>(actions, etc.)?

That's usually a good idea. The menu item "make own subclass"
will make a subclass for you automatically. Then you can use the
"browse class" menu item to get a browser in which to start writing
methods for your subclass. Since its your subclass, you don't have
to worry about breaking the behavior of some other morph.


Re: Layout, checkerboard

See LayoutMorph and HolderMorph. LayoutMorph lays things out
in a single row or column. HolderMorph lays things out left-to-right
with wrapping. The simples checkerboard can be made by dragging
nine Rectangles  of alternating colors into a HolderMorph.

	-- John





More information about the Squeak-dev mailing list