'From Squeak3.6 of ''6 October 2003'' [latest update: #5424] on 14 October 2003 at 9:18:39 am'! "Change Set: MorphSaveOnFileFix Date: 26 July 2002 Author: Kazuhiro ABE NISHIHARA Satoshi (Ned Konz 2003-10-14: re-posted with minor edits: added text from original email changed size==0 to isEmpty) A Morph that rendered by a TransformationMorph is not saved correctly. In this case, it needs to save a renderer instead of itself. To demonstrate the problem: 1. make an Ellipse morph 2. write a following script: Ellipse turn: 5 3. tick the script 4. save this morph by 'save morph in file' menu of debug halo 5. load the morph by 'load as morph' menu from filelist. 6. tick the script again 7. OOPS!!!! File in the attached changes, now saving and loading will work. "! !Morph methodsFor: 'fileIn/out' stamp: 'nk 10/14/2003 09:16'! saveOnFile "Ask the user for a filename and save myself on a SmartReferenceStream file. Writes out the version and class structure. The file is fileIn-able. UniClasses will be filed out. Fixed by Kazuhiro ABE on 26 July 2002 to work correctly with transformed morphs." | aFileName fileStream ok topRendererOrSelf | aFileName _ ('my ', self class name) asFileName. "do better?" aFileName _ FillInTheBlank request: 'File name? (".morph" will be added to end)' initialAnswer: aFileName. aFileName isEmpty ifTrue: [^ self beep ]. topRendererOrSelf _ self topRendererOrSelf. topRendererOrSelf allMorphsDo: [:m | m prepareToBeSaved]. ok _ aFileName endsWith: '.morph'. "don't double them" ok _ ok | (aFileName endsWith: '.sp'). ok ifFalse: [aFileName _ aFileName,'.morph']. fileStream _ FileStream newFileNamed: aFileName. fileStream fileOutClass: nil andObject: topRendererOrSelf. "Puts UniClass definitions out anyway"! !