s LearnSqueak.com

SQUEAK 6.0 / THE OBJECT REFERENCE

Your interface.
Made of Morphs.

A shape, a label, a button, a whole window. Meet the objects that turn Smalltalk messages into something you can see and change.

36 native examples19 basic classes138 passed checks
REAL OBJECTS. REAL SQUEAK PIXELS.↙ EXPLORE

Every screenshot below comes from executing its displayed code in Squeak.

CREATE AN OBJECTSEND IT MESSAGESADD IT TO THE WORLDINSPECT WHAT HAPPENS

01 / THE MORPHIC OBJECT LIBRARY

Find your building block.

Choose an object for its screenshot,
complete code, and messages to try.

What “all basic objects” covers here

Every class in this image’s Morphic-Basic and Morphic-Basic-NewCurve categories, plus the common foundations, containers, and form controls. Squeak has many more specialized Morph subclasses. This is a complete reference for those two basic categories, with practical additions.

All objects

Select a card to view its example ↑

02 / FROM CODE TO YOUR WORLD

Three steps. A live object.

These are Workspace expressions.
Select each complete example and Do it.

01

Open a Workspace

Open PenStudioMorphic.image with Squeak 6.0. Use the World menu to open a Workspace. Paste an entire example, including its temporary-variable declaration.

02

Load the helper when needed

Six model-connected examples use MorphicReferenceModel. Download its file, find it in Squeak’s File List, and choose fileIn once. Examples that need it are marked.

Download helper class ↓
03

Do it, then explore

Select the code and choose Do it from the Workspace menu. The Morph opens in the World. Open its halo or Inspector to explore its class, owner, submorphs, and state.

Learn the Morphic basics →

The website displays source and recorded screenshots. Execute the Smalltalk in Squeak; JavaScript does not simulate these native objects.

03 / ONE SHARED PROTOCOL

Messages you’ll use everywhere.

Geometry, ownership, appearance,
and lifecycle come from Morph.

To keep a reference for these experiments, paste the first Morph example, remove its | morph | temporary declaration, and Do it. Squeak will offer to define morph as a Workspace variable. Then evaluate the messages below in that Workspace. morph must refer to that object; use Print it or Inspect it for queries.

What you wantSend this messageWhat happens
Movemorph position: 100@100.Sets the top-left location.
Resizemorph extent: 220@110.Sets width and height; subclasses may constrain them.
Recolormorph color: Color blue.Changes the Morph’s color; bitmap content uses its own pixels.
Add a childmorph addMorph: (StringMorph contents: 'Hello').Embeds another Morph and assigns its owner.
Inspect childrenmorph submorphs.Returns the immediate child Morphs.
Inspect the ownermorph owner.Returns the containing Morph, often the World.
Open handlesmorph addHalo.Shows native editing handles around this object.
Removemorph delete.Detaches the object from its owner.

04 / EXECUTED, RENDERED, CHECKED

You can follow the evidence.

36 exact code snippets.
36 native PNGs. Zero failed checks.

How the examples were verified

The installed Squeak 6.0 VM evaluated each complete snippet against PenStudioMorphic.image. The runner checked the returned object’s type and renderable bounds, captured it with Morph’s native rendering into a 640 × 350 Form, saved a PNG, and read it back.

Additional checks exercised geometry, ownership, label refresh, button actions, slider writes, text acceptance, selection changes, checkbox toggling, animation frames, and one-time stepping. Each object’s panel lists its checks. The screenshots show the initial specimen, before those additional checks change its state.

The runner exits without saving the image. The displayed examples are the exact strings evaluated by the runner. Special image-specific behavior is explained in the relevant object’s notes.

Download original PNG ↓