<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Thanks Ben. It was very helpful.<div><br></div><div>Azka<br><br><div>&gt; Date: Thu, 3 Oct 2013 16:54:06 +0800<br>&gt; From: btc@openInWorld.com<br>&gt; To: beginners@lists.squeakfoundation.org<br>&gt; Subject: Re: [Newbies] Dismissing an object<br>&gt; <br>&gt; <br>&gt; Hi Azka,<br>&gt; <br>&gt;  Maybe this helps: http://wiki.squeak.org/squeak/1584<br>&gt; <br>&gt; Azka Niazi wrote:<br>&gt; &gt; When we create an instance of a class with the new method, it does not show up in the world unless we use the openInWorld method. <br>&gt; <br>&gt; <br>&gt; The 'World' Morphic UI interface is only a part of the system.  There <br>&gt; are many more classes dealing with non-UI facilities like file access, <br>&gt; file access, process scheduling and collections.  Should <br>&gt; "OrderedCollection new" somehow appear on the screen ?<br>&gt; The #new method deals with the generic activity of creating new <br>&gt; instances only, not the additional function of asking a morph to display <br>&gt; itself in the World.<br>&gt; <br>&gt; <br>&gt; &gt; To make it disappear we tried dismiss me option from the halo menu. <br>&gt; <br>&gt; By saying "tried" you imply this action failed. What gives you this <br>&gt; impression?<br>&gt; <br>&gt; &gt; Does the dismissed object remain created somewhere in the background or does it get completely deleted from the system. <br>&gt; It depends on if anything besides the 'World' references the object. In <br>&gt; particular, if you store the instance in a variable in Workspace, that <br>&gt; will prevent it from being garbage collected. For example, copy the <br>&gt; following to a Workspace the evaluate each line one at a time.<br>&gt; <br>&gt; Smalltalk garbageCollect.    EllipseMorph allInstances inspect.  <br>&gt; "Observe no instances"<br>&gt; x := EllipseMorph new. "Creates a new instance"<br>&gt; EllipseMorph allInstances inspect.  "Observe one instance"<br>&gt; x openInWorld. "Displays the instance"<br>&gt; "Close the morph using the halos"<br>&gt; Smalltalk garbageCollect.    EllipseMorph allInstances inspect.    <br>&gt; "Observe instance remains"<br>&gt; x openInWorld.  "Re-displays same instance"<br>&gt; "Close the morph using the halos"<br>&gt; x := nil.   <br>&gt; Smalltalk garbageCollect.    EllipseMorph allInstances inspect. "Observe <br>&gt; no instances"<br>&gt; <br>&gt; <br>&gt; &gt; Also, we have to ask, does evaluating (meaning repeatedly using the do it option) for the code which looks like this:className newCreate multiple objects of the same class in the background, or does it override the previously created object?<br>&gt; &gt; Azka         <br>&gt; <br>&gt; Multiple evaluations of "SomeClassName new" creates multiple independent <br>&gt; instances of that class.<br>&gt; <br>&gt; cheers -ben<br>&gt; <br>&gt; _______________________________________________<br>&gt; Beginners mailing list<br>&gt; Beginners@lists.squeakfoundation.org<br>&gt; http://lists.squeakfoundation.org/mailman/listinfo/beginners<br></div></div>                                               </div></body>
</html>