<br><br><div class="gmail_quote">On Fri, Feb 12, 2010 at 9:43 AM, Richard Durr <span dir="ltr">&lt;<a href="mailto:richard.durr@googlemail.com">richard.durr@googlemail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
or<br>
<br>
YourClass new asCpmponent addValidatedForm: #( save new cancel).<br>
<br>
or<br>
| actionButtons |<br>
<br>
actionButtons := Array<br>
  with: [ :param | &quot; do something&quot; ] -&gt; &#39;Label&#39;<br>
  with: [ :param | &quot; do something different&quot; ] -&gt; &#39;Another Label&#39;<br>
  with: [ :param | &quot; do something entirely different&quot; ] -&gt; &#39;Yet Another Label&#39;.<br>
YourClass new asCpmponent addValidatedForm: actions.<br>
<div><div></div><br></div></blockquote><div><br>My current code does this: <br><br>component onAnswer: [ :answer | answer isNil ifFalse: [ answer doSave ] ].<br><br><br>I believe that the value of answer is going to be the object being edited.  It&#39;s really unclear to me, and this is more of a general smalltalk question, of what the &quot;context&quot; is in a block like this when it gets executed. And when I write &quot;context&quot; there, I mean what objects are visible and available to act on. In C, I&#39;d think of it as the stack frame, but It&#39;s not at all clear to me what &quot;context&quot; refers to in smalltalk. <br>
<br>In your block:<br>[:param | &quot;do something&quot;] is that code in someway associated with the context it was declared in? Is the object referenced by actionButtons still visible and instantiated? Assuming that this whole block of code that you wrote was a method on MyClass, is the instance of MyClass that handled the method available to this block? <br>
<br>See I am a total Noob. ;-)<br><br><br>Tony<br></div></div>