<div>On Fri, Oct 22, 2010 at 6:37 PM, John McKeon <span dir="ltr">&lt;<a href="mailto:p3anoman@gmail.com">p3anoman@gmail.com</a>&gt;</span> wrote:</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br><br><div class="gmail_quote"><div class="im">On Fri, Oct 22, 2010 at 8:31 PM, Elliot Finley <span dir="ltr">&lt;<a href="mailto:efinley.lists@gmail.com" target="_blank">efinley.lists@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This means the editor needs to operate on a copy of the object.<br></blockquote><div><br></div></div><div>Yes, and the only place you can put code to deal with the copy is in the button callbacks. In this configuration though, answer: is of no use. You would need to do something else...  </div>
<div><div></div><div class="h5">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><div class="gmail_quote"><br></div></blockquote></div></div></div></blockquote><div>This is how I did it.  I&#39;m a Smalltalk beginner, so there is probably a much better way.</div>
<div> </div><div> IAddress&gt;&gt;initialize</div><meta charset="utf-8"><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>super initialize.</div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>editor := ContactView new.</div>
<div><span class="Apple-tab-span" style="white-space: pre; ">        </span>self editContact: self contacts first.</div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>editor onAnswer: [ :answer | answer ifTrue: [ self save ] ifFalse: [ self cancel ] ]</div>
<div><br></div><div><div>IAddress&gt;&gt;editContact: aContact</div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>contactCurrentlyBeingEdited := aContact.</div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>editor contact: aContact copy.</div>
</div><div><br></div><div><div>IAddress&gt;&gt;save</div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>Contact removeContact: contactCurrentlyBeingEdited; addContact: editor contact</div></div><div>
<br></div><div><div>IAddress&gt;&gt;cancel</div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>self editContact: contactCurrentlyBeingEdited.</div></div><div><br></div></div>