<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi All, Hi Marcel,<div><br></div>  let's imagine you want to emphasize a text with PluggableTextAttributes and you want to emphasize/print the text as quickly as possible and defer interpreting the text until later. Let's imagine that each substring you're emphasizing is a number that needs parsing to get the numeric value.  What you *don't* want to do is to create a PluggableTextAttribute for every different numeric substring.  What you'd like instead is use a single PlyggableTextAttribute for all such substrings and do the parsing when a particular numeric substring is selected.  To do this you'll need to change PluggableTextAttribute because by default if its actionBlock takes an argument the block is evaluated with the model.</div><div dir="ltr"><br></div><div dir="ltr">This is exactly what I wanted today for inspecting objects in the VM simulator.  Here I want to click on an oop, which may be one of many in a large text, and have this result in a subsequent inspector pop up (actually an inform: which can be inspected or discarded.  Otherwise I have to create a different PluggableTextAttribute for every oop in the text, and that's slow and difficult.</div><div dir="ltr"><br></div><div dir="ltr">So to be able to write this:</div><div dir="ltr"><br></div><div dir="ltr">CogOopInspector>>text<div dir="ltr"><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>^Text streamContents:</div><div dir="ltr"><span class="gmail-Apple-tab-span" style="white-space:pre">              </span>[:s| coInterpreter printOop: oop on: s oopAttribute: (PluggableTextAttribute evalBlock: [:myself :oopString| self interpretOopString: oopString])]</div><div dir="ltr"><br></div><div>where each oop that printOop:on:oopAttribute: gets emphasized with one PluggableTextAttribute, deferring the costly parsing until the click (which is the right time, because that's the time when there's a costly UI action to perform),</div><div dir="ltr"><br></div><div>I had to add this override to PluggableTextAttribute:</div><div><br></div><div><div>PluggableTextAttribute>>actOnClickFor: model in: aParagraph at: clickPoint</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">  </span>"Override to pass in the string with this attribute to the block if it takes two arguments."</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>| range |</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>(evalBlock notNil and: [evalBlock numArgs = 2]) ifFalse:</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">               </span>[^super actOnClickFor: model in: aParagraph at: clickPoint].</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">   </span>range := aParagraph text</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                               </span>rangeOf: self</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                          </span>startingAt: (aParagraph characterBlockAtPoint: clickPoint) stringIndex.</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>evalBlock value: model value: (aParagraph text string copyFrom: range first to: range last).</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">   </span>^true</div></div><div><br></div><div>For now I'll keep this as an extension in the VMMakerUI package.  But I think it is generally useful and should go in the base.  Do you agree?  If so, I'll try and remember ti add it after the release.</div>_,,,^..^,,,_<br>best, Eliot</div></div></div></div></div></div></div>