Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
morph basics
m := Morph new.
m openInWorld.
m extent: 50@50.
m height: 100.
m width: 50.
m openInWindowLabeled: 'My First Morph'.
editor := TextMorph new.
editor openInWindow.
window := SystemWindow new.
window openInWorld .
window addMorph: editor frame: ( 0@0 extent: 100@100).
editor backgroundColor: Color black.
window setLabel: 'My editor'.
sm := StringMorph contents: 'Hello World'.
window addMorph: sm frame: (0@0 extent: 100@100).
sm color: (Color red).
sm position: 300@300.
sm openInWindow.
window submorphs.
m2 := Morph new.
m2 color: (Color red).
window addMorph: m2 frame: ( 0@100 extent: 200@200).
window submorphs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment