[Newbies] EventHandler "value parameters are passed as first of 3 arguments" ?

John-Reed Maffeo jrmaffeo at gmail.com
Thu Jan 11 02:33:18 UTC 2018

#EventHandler halts with this warning from the method #on:send:to:withValue:

How does this work? I can't find an example.

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.

start -------------------
|borMor tMor1 tMor2 |

borMor := BorderedMorph new.
borMor color: Color white.
borMor width: 44.
tMor1 := TextMorph new.
tMor1 contents: 'Hello World!'.
tMor2 := TextMorph new.
tMor2 contents: '?????'.
tMor1 addDependent: tMor2.

borMor  layoutPolicy: TableLayout new;
listDirection: #leftToRight;
wrapCentering: #topLeft;
hResizing: #spaceFill;
vResizing: #spaceFill;
layoutInset: 2;
rubberBandCells: true.

borMor addMorph: tMor1.
tMor1 addDependent: tMor2.
borMor addMorph: tMor2.
tMor1 on: #mouseLeave send: #contents: to: tMore2 withValue: #(tMor1
contents nil).

borMor openInWorld.

end -----------------

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.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/beginners/attachments/20180111/b912e503/attachment.html>

More information about the Beginners mailing list