Saving morphs to file

Lic. Edgar J. De Cleene edgardec2001 at yahoo.com.ar
Sun Jul 16 09:34:55 UTC 2006


Damien Cassou puso en su mail :

> Hi,
> 
> how can I save a morph to a file so that I can load it back later ?
> 
> The morph is a UMLPackage made with Connectors (this package is very cool).
> 
> 
> Thank you
Select the morph via halo, go to debug menu, select save morph in file.
And if you wish a more "intelligent morph" , what load in almost any Squeak.
In the debug menu select inspect.
In the lower pane write

| fileStream aFileName |
aFileName _ 'SmartTrashCan.morph'.
    fileStream _ FileStream newFileNamed: aFileName.
    fileStream fileOutClass: self class andObject: self.

I send the morph, for see in action drag and drop on any 3.8 or newer and
select via file list and load as morph in 3.7 and earlier.

This things "eats", all same class Morph on your desk (useful for puzzles
and games).

More questions ?

Edgar 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: SmartTrashCan.morph
Type: application/octet-stream
Size: 14397 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20060716/4d3e7625/SmartTrashCan.obj


More information about the Squeak-dev mailing list