pharo-users@lists.pharo.org

Any question about pharo is welcome

View all threads

How to make a TextMorph editable

JR
Jim Rosenberg
Wed, Feb 25, 2026 10:11 AM

I am a rank newbie to Pharo, but have been using Squeak to create
interactive content for many years now, and am trying to extrapolate my
Squeak experience to Pharo.

Under Squeak, the following code creates a new Text Morph which is
immediately editable:

(TextMorph new initialize contents: 'Hello World') openInWorld

When I put this code into a Pharo Playground and click the Do it all
button, the text appears in the World, when the cursor is moved over the
text it changes to the "I-bar" expected for editing, but nothing works.

What do I have to do to get it to be editable?

I'm guessing maybe handleEdit: with a suitable block -- well what,
actually? Is this documented somewhere?

Also: Under Squeak the debug halo includes a choice "save morph in file".
Is there a way to do this in Pharo? Is is possible to save a morph in
Squeak and then load it into Pharo?

-Thanks in advance, Jim

I am a rank newbie to Pharo, but have been using Squeak to create interactive content for many years now, and am trying to extrapolate my Squeak experience to Pharo. Under Squeak, the following code creates a new Text Morph which is immediately editable: (TextMorph new initialize contents: 'Hello World') openInWorld When I put this code into a Pharo Playground and click the Do it all button, the text appears in the World, when the cursor is moved over the text it changes to the "I-bar" expected for editing, but nothing works. What do I have to do to get it to be editable? I'm guessing maybe handleEdit: with a suitable block -- well what, actually? Is this documented somewhere? Also: Under Squeak the debug halo includes a choice "save morph in file". Is there a way to do this in Pharo? Is is possible to save a morph in Squeak and then load it into Pharo? -Thanks in advance, Jim