[Cuis-dev] Be notified of edit from TextModelMorph

Juan Vuletich JuanVuletich at zoho.com
Tue Feb 22 05:14:41 PST 2022


Hi Hilaire,

I've just pushed 3 changesets that allow #acceptOnAny: and 
#keystrokeAction: . Please take a look.

Thanks,

On 2/17/2022 11:26 AM, Hilaire Fernandes via Cuis-dev wrote:
>
> Hi guys,
>
> This does the trick, I prefer to use keyStroke (up and down key), 
> keyDown works with a delay, model udpated at second key down:
>
> inputWidget scroller
>         setProperty: #keyStroke:
>         toValue: [:event | inputWidget scroller acceptContents].
>
> May be a helper flag to autoUpdate the model.
>
> 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.
>
> Thanks
>
> Le 17/02/2022 à 00:13, Juan Vuletich via Cuis-dev a écrit :
>>> This works setting properties on TextModelMorph innerTextMorph, 
>>> which is not ideal, but works if you want to avoid subclassing at 
>>> all costs:
>>>
>>> tm := TextModelMorph withText: 'test'.
>>>
>>> tm innerTextMorph setProperty: #'keyDown:'
>>>     toValue: [:ev | Transcript show: ev].
>>>
>>
>> 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.
> -- 
> GNU Dr. Geo
> http://drgeo.eu
> http://blog.drgeo.eu


-- 
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
https://independent.academia.edu/JuanVuletich
https://www.researchgate.net/profile/Juan-Vuletich
https://patents.justia.com/inventor/juan-manuel-vuletich
@JuanVuletich

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20220222/382a7251/attachment.htm>


More information about the Cuis-dev mailing list