<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><font size="4">Hi guys,</font></p>
<p><font size="4">This does the trick, I prefer to use keyStroke (up
and down key), keyDown works with a delay, model udpated at
second key down:<br>
</font></p>
<p><font size="4"> <font face="monospace"> inputWidget scroller<br>
setProperty: #keyStroke: <br>
toValue: [:event | inputWidget scroller
acceptContents]. </font><br>
</font></p>
<p><font size="4">May be a helper flag to autoUpdate the model. <br>
</font></p>
<p><font size="4">Or something more general with a block, but
likely, it is just one line to add in the user code, so not sure
you need to do it. But yes, an autoUpdate flag will be handy
enought for casual users of TextModelMorph.<br>
</font></p>
<p><font size="4">Thanks<br>
</font></p>
<div class="moz-cite-prefix">Le 17/02/2022 à 00:13, Juan Vuletich
via Cuis-dev a écrit :<br>
</div>
<blockquote type="cite" cite="mid:620D850B.30807@zoho.com">
<blockquote type="cite" style="color: #999999;">This works setting
properties on TextModelMorph innerTextMorph, which is not ideal,
but works if you want to avoid subclassing at all costs:
<br>
<br>
tm := TextModelMorph withText: 'test'.
<br>
<br>
tm innerTextMorph setProperty: #'keyDown:'
<br>
toValue: [:ev | Transcript show: ev].
<br>
<br>
</blockquote>
<br>
This looks like a good way to do it. Maybe we could add some
helper method(s) to TextModelMorph to ease it. Maybe
#keyDownAction: would be handy.
<br>
</blockquote>
<pre class="moz-signature" cols="72">--
GNU Dr. Geo
<a class="moz-txt-link-freetext" href="http://drgeo.eu">http://drgeo.eu</a>
<a class="moz-txt-link-freetext" href="http://blog.drgeo.eu">http://blog.drgeo.eu</a></pre>
</body>
</html>