<div id="__MailbirdStyleContent" style="font-size: 12pt;font-family: calibri;color: #000000">
                                        
                                        
                                            
                                        
                                        
                                        Hi, there. :)<div><br></div><div>Well, #on:send:to: works best if the target's source code is under your control. In your example, you would implement something like #setContentsEvent:from: in MyTextMorph. There, you have access to the mouse event and to the source morph to access the contents.</div><div><br></div><div>I would like to explain two other things, too:</div><div>1) You only need to call #addDependent: in the source if you want to implement or use #update: in the target. That's not the case in your example. You do not need it here.</div><div>2) The way #on:send:to:withValue: works is, in my opinion, broken. It only supports you to configure a single, hard-coded value, to be passed as first argument in a three-arg-selector. This is useless if you think about having multiple callbacks configured via #on:send:to:withValue:. We should fix that in the future.</div><div><br></div><div>Best,</div><div>Marcel</div><div class="mb_sig"></div>
                                        
                                        <blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
                        <p style="color: #AAAAAA; margin-top: 10px;">Am 11.01.2018 03:33:27 schrieb John-Reed Maffeo <jrmaffeo@gmail.com>:</p>_______________________________________________
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div>#EventHandler halts with this warning from the method #on:send:to:withValue:</div><div><br></div>How does this work? I can't find an example.<div><br></div><div>I am trying to learn how to use TextMorph in an application. My simple test case is a morph containing two TextMorphs. I want the second morph to contain the contents of the first morph when that morph loses focus.</div><div><br></div><div>start -------------------</div><div><div>|borMor tMor1 tMor2 |</div><div><br></div><div>borMor := BorderedMorph new.</div><div>borMor color: Color white.</div><div>borMor width: 44.</div><div>tMor1 := TextMorph new.</div><div>tMor1 contents: 'Hello World!'.</div><div>tMor2 := TextMorph new.</div><div>tMor2 contents: '?????'.</div><div>tMor1 addDependent: tMor2.</div><div><br></div><div>borMor  layoutPolicy: TableLayout new;</div><div><span style="white-space:pre">   </span> listDirection: #leftToRight;</div><div><span style="white-space:pre"> </span> wrapCentering: #topLeft;</div><div><span style="white-space:pre">     </span> hResizing: #spaceFill;</div><div><span style="white-space:pre">       </span> vResizing: #spaceFill;</div><div><span style="white-space:pre">       </span> layoutInset: 2;</div><div><span style="white-space:pre">      </span> rubberBandCells: true.</div><div><br></div><div>borMor addMorph: tMor1. </div><div>tMor1 addDependent: tMor2.</div><div>borMor addMorph: tMor2.<span style="white-space:pre">  </span></div><div>tMor1 on: #mouseLeave send: #contents: to: tMore2 withValue: #(tMor1 contents nil).<span style="white-space:pre">   </span></div><div><br></div><div><br></div><div>borMor openInWorld.</div><div><br></div><div>end -----------------</div><div><br></div><div>This may not be the best way to approach the problem, but I would like to know how to use the method in any case.</div><div><br></div><div>Thanks,</div><div><br></div><div>jrm</div><div><br></div><div><br></div></div></div>

                        </blockquote></div>