Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Programming morphs - page 2 - name
Last updated at 7:08 pm UTC on 12 June 2018
Page 2 shows a blue morph.


The text in a workspace is:

The morph above is named "joe". (Most of the morphs in this example will be named "joe", in fact). While you can send commands to joe just by knowing its name, there are a couple of halo handles that allow you to inspect or send commands to a morph even if you don't have a handy name for the object.

First, you must make halos appear. Press the "blue" button if your mouse has three buttons. On MS Windows, the blue button is the middle button, while on every other OS the blue button is the button farthest to the right. If your mouse has less than three buttons, then make halos appear by holding Alt as you press the red button (the primary button). Press the blue button (or Alt plus the red button) until you obtain a halo around Joe. It should look like this:

All of the halo handles are useful, but the gray one near the top right has options particularly useful for programming.



Try the following options:

1. inspect morph - open an Inspector on the morph. Then, you can send commands to the morph by sending messages to "self". For example, try
 self color: Color green
inside the inspector to turn Joe green.

2. browse morph class - open a SystemBrowser browsing the morph's class. This can be used to read and to modify the code that defines the morph. (You'll notice that Joe is a plain Morph.)