views:

96

answers:

1

How do I reference (i.e. program) a Morph created by direct manipulation, for instance dragging a text box from the supplies menu to the desktop, via Squeak/Smalltalk code in say the workspace? I'm okay (well sort of - I'm just learning Morphic) when I instantiate a Morph via Squeak/Smalltalk code but I'm at a loss when I've dragged a Morph into existence.

A: 

Thanks to Mike Stramba on the Squeak mailing list for the following:-

Drag and dropping the morph on a workspace is good start (you have to click on the "square" in the workspace header, and turn on the "create textual reference to dropped morphs" option).

Also when you create the morph it gets added to the current "desktop" (world) submorphs instance variable.

You can MMB on the "desktop", click the debug tab and explore the current world. You'll see it's a PasteUpMorph.

You can get all the PasteUpMorphs in the image with : p := PasteUpMorph allInstances, which returns an array of all the projects "desktops" in the image.

KHWP