[Cuis-dev] TextModelMorph and source code style

Mariano Montone marianomontone at gmail.com
Tue Apr 12 13:15:04 PDT 2022


You mentioned it is Smalltalk source code, so implement this in your 
textProvider:

textStylerClassFor: textGetter

     ^SHTextStylerST80

If you want Smalltalk editor functionality (doIt, printIt, etc), 
implement textEditorFor: too:

editorClassFor: textGetter
     ^SmalltalkEditor

I haven't tested this, but I think it should work.

Mariano

El 12/4/22 a las 17:00, Mariano Montone escribió:
> Hi,
>
> TextModel is asked for the TextStyler class via #textStylerClass message.
>
> You can look at:
> - Implementors of #textStylerClass
> - SHTextStyler class and subclasses.
> - Implementors of #textStylerClassFor:
>
> You need your textProvider to implement #textStylerClassFor: and 
> return an instance of SHTextStyler class, if I'm not mistaken.
>
> Cheers,
>
> Mariano
>
> El 12/4/22 a las 16:29, Hilaire Fernandes via Cuis-dev escribió:
>>
>> Hi,
>>
>> I have this TextModelMorph with Smalltalk source code:
>>
>>     codeView := TextModelMorph textProvider: self textGetter:
>>     #sourceCode.
>>
>> and I want it to style the code. How can I do it?
>>
>> I did not find
>>
>> Thanks
>>
>> Hilaire
>>
>>
>> -- 
>> GNU Dr. Geo
>> http://drgeo.eu
>> http://blog.drgeo.eu
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20220412/c5bfd548/attachment-0001.htm>


More information about the Cuis-dev mailing list