[Cuis-dev] Be notified of edit from TextModelMorph

Juan Vuletich JuanVuletich at zoho.com
Wed Feb 16 15:13:15 PST 2022


Hi Folks,

On 16/02/2022 05:56 p.m., Mariano Montone via Cuis-dev wrote:
> El 16/2/22 a las 17:38, Hilaire Fernandes via Cuis-dev escribió:
>> Yes, I know. I want to explore all other options before subclassing.
>>
>> TextModelMorph and its companion classes have a lot of method, so I 
>> may have miss some of its behavior.
>
> 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].
>
> tm openInWorld
>
> I don't know if there's other way to do it using TextModelMorph 
> protocol ...
>
> Cheers,
>
> Mariano

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.


Thanks,

-- 
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



More information about the Cuis-dev mailing list