<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 12-09-10 7:34 PM, Andy Burnett
wrote:<br>
</div>
<blockquote
cite="mid:CAB0JYDgSSYzEwYzzRaJayjTa+6++YB3z56jY3oPsCvZywr=0tQ@mail.gmail.com"
type="cite">Hello,
<div><br>
</div>
<div>Is there a method - or other mechanism - that would let me
find all instances of 'foo' and replace them with 'bar' within
an image? I imagine there must be, but I can't find it.</div>
<div><br>
</div>
<div>Cheers</div>
<div>Andy</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Beginners mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Beginners@lists.squeakfoundation.org">Beginners@lists.squeakfoundation.org</a>
<a class="moz-txt-link-freetext" href="http://lists.squeakfoundation.org/mailman/listinfo/beginners">http://lists.squeakfoundation.org/mailman/listinfo/beginners</a>
</pre>
</blockquote>
Try this: <br>
<br>
OrderedCollection allInstances size<br>
<br>
Print that. That's the number of instances of OC in the image. Now
try <br>
<br>
OrderedCollection allInstances <br>
<br>
or <br>
<br>
OrderedCollection allInstances first<br>
<br>
And take a look at the living instances inside the image. That's how
you find instances. Replacing them is kind of a different issue. I'd
say two things about that. The first is you don't want to just
replace instances in the image. You need to be more specific of the
context of your instances. Are they in an OrderedCollection or an
Array? If so, find that instance and change them inside. <br>
<br>
The second thing is you wouldn't generally replace instances in the
image. Just wait and they'll be eaten by the garbage collector. <br>
<br>
So finding instances is not to hard. Use #allInstances. To replace
them you need to look not so much at the whole image but the
application those instances are in. Inside your app. <br>
<br>
Oh, yea. You can use OrderedCollection allIstances and both explore
and inspect. You can see inside the instances that way. (Explore and
inspect are one of the main menus.) <br>
<br>
Hope that helps, <br>
Chris <br>
<br>
<br>
</body>
</html>