<br>Hi all,<br><br>I was wondering if there are any built-in facilities for taking a particular instance a class <b>X</b>, call it <b>anX,</b> and creating from it a class method that returns an identical instance of <b>anX</b> for future use.<br>
<br>For example, say I&#39;m futzing around in a workspace with an instance of a class called <b>InteractiveWindowShape</b>, tweaking things so that I have a nice window with all the colors and proportions and buttons I want, perhaps using Morphs to create the thing dynamically (so it&#39;s some kind of Morph object). In the course of this I get an instance of <b>anInteractiveWindowShape</b> that I am satisfied with, all the instance variables set just right. Let&#39;s call this object<b> | idealShape |</b>. It&#39;s just sitting there, rather vulnerably, in a workspace, the result of my using various screen tools over the last half hour. Now, I don&#39;t just want to <i>save</i> this object: I want to be able to create an identical one whenever I like. So what I want is a Class method, <b>InteractiveWindowShapes class&gt;&gt;</b><b>newIdealShape,</b> that creates an instance exactly like <b>idealShape.</b><br>
<br>Is there a message I can send <i>to this instance</i> <b>idealShape</b> that would return a block of code that would act as a class method, which I could then call <b>newIdealShape</b>, and which would return an identical instance?<br>
<br>I suspect such a general method might not exist, due to the potential hazards surrounding the deep copy problem; I also suspect I may not be imagining the best sort of solution to my problem. Is there a strategy for this?<br>
<br>Thanks all!<br><br>Erich<br>