[Cuis-dev] Re : Re: Morph to just represents paragraphs of text

Juan Vuletich juan at jvuletich.org
Mon Nov 1 06:22:08 PDT 2021


On 11/1/2021 5:55 AM, H. Fernandes via Cuis-dev wrote:
> Hi Juan,
>
> I think it is a useful addition to Cuis. In the mean time, I cooked a very simple Morph with only 3 methods (attached). But it is nice to have a more complete Morph where you can select and copy the text.
>
> Dr. Geo -- http://drgeo.eu

Wow! I'm very impressed! You made it one tenth the size of my attempt! 
This is the kind of code we'd strive for.

I saw that it doesn't do wordwrap. I think wordwrap is useful, and for a 
simplest possible text morph, it can be mandatory. Doing this also fixes 
centered text, and text aligned to the right edge. So I did that, and I 
also made it play well inside a ScrollPane. I needed to add 3 additional 
methods. I also change the name to TextParagraphMorph. The result is 
attached.

I think this is a very good addition, and given that the regular 
TextModelMorph can be made read only (for apps requiring copy to 
clipboard), I think that my ReadOnlyTextMorph can (and should) be 
replaced by this. If you agree, and nobody complains, I'll later push it.

Thanks a lot!

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

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: TextParagraphMorph.st
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20211101/120db280/attachment.ksh>


More information about the Cuis-dev mailing list