<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>> Date: Thu, 3 Oct 2013 16:54:06 +0800<br>> From: btc@openInWorld.com<br>> To: beginners@lists.squeakfoundation.org<br>> Subject: Re: [Newbies] Dismissing an object<br>> <br>> <br>> Hi Azka,<br>> <br>> Maybe this helps: http://wiki.squeak.org/squeak/1584<br>> <br>> Azka Niazi wrote:<br>> > 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>> <br>> <br>> The 'World' Morphic UI interface is only a part of the system. There <br>> are many more classes dealing with non-UI facilities like file access, <br>> file access, process scheduling and collections. Should <br>> "OrderedCollection new" somehow appear on the screen ?<br>> The #new method deals with the generic activity of creating new <br>> instances only, not the additional function of asking a morph to display <br>> itself in the World.<br>> <br>> <br>> > To make it disappear we tried dismiss me option from the halo menu. <br>> <br>> By saying "tried" you imply this action failed. What gives you this <br>> impression?<br>> <br>> > Does the dismissed object remain created somewhere in the background or does it get completely deleted from the system. <br>> It depends on if anything besides the 'World' references the object. In <br>> particular, if you store the instance in a variable in Workspace, that <br>> will prevent it from being garbage collected. For example, copy the <br>> following to a Workspace the evaluate each line one at a time.<br>> <br>> Smalltalk garbageCollect. EllipseMorph allInstances inspect. <br>> "Observe no instances"<br>> x := EllipseMorph new. "Creates a new instance"<br>> EllipseMorph allInstances inspect. "Observe one instance"<br>> x openInWorld. "Displays the instance"<br>> "Close the morph using the halos"<br>> Smalltalk garbageCollect. EllipseMorph allInstances inspect. <br>> "Observe instance remains"<br>> x openInWorld. "Re-displays same instance"<br>> "Close the morph using the halos"<br>> x := nil. <br>> Smalltalk garbageCollect. EllipseMorph allInstances inspect. "Observe <br>> no instances"<br>> <br>> <br>> > 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>> > Azka         <br>> <br>> Multiple evaluations of "SomeClassName new" creates multiple independent <br>> instances of that class.<br>> <br>> cheers -ben<br>> <br>> _______________________________________________<br>> Beginners mailing list<br>> Beginners@lists.squeakfoundation.org<br>> http://lists.squeakfoundation.org/mailman/listinfo/beginners<br></div></div>                                            </div></body>
</html>