[Cuis-dev] TextModelMorph comments

Bernhard Pieber bernhard at pieber.com
Sun Apr 6 08:48:22 PDT 2025


Hi Mark,

Thanks for your suggestions. I like your class comment. IMO it could be taken as is. If it should be shorter here is what I suggest based on your text:

A TextModelMorph enables users to view and edit text. Its main features are:
- using either a TextModel or TextProvider to hold the text being edited
- styling and text wrapping (provided by InnerTextMorph)
- scrolling with scrollbars (provided by superclass PluggableScrollPane)

There are two approaches for creating instances. One approach is to hold the text value in a TextModel object. The class methods withModel: and withText: support this. The other approach is to hold the text value in a TextProvider. The class methods that begin with textProvider: support this. For examples, see the method comments in those class methods.

A border is displayed when it has focus.

By default, words that would extend past the right side wrap to the next line. To prevent wrapping, send an instance #wrapFlag: with an argument of false.

To change the size, send an instance #morphExtent: with a Point argument. The size should include space for scroll bars if they may be needed. Setting the height to zero causes it to actually be set to the height required for a single line in the current font.

Related classes include TextModel, PluggableTextModel, TextProvider, PluggableScrollPane, and InnerTextMorph.

Cheers
Bernhard

> Am 06.04.2025 um 14:27 schrieb Mark Volkmann via Cuis-dev <cuis-dev at lists.cuis.st>:
>
> I'd love to get suggestions from others that share how they would reword this, including what they would cut. I just included everything I felt was important to know when I started learning about this class.
>
> On Sat, Apr 5, 2025 at 1:15 AM Hilaire Fernandes via Cuis-dev <cuis-dev at lists.cuis.st> wrote:
>
>> Thanks Mark!
>>
>> There are important tips in your suggested comment.
>>
>> It seems a bit too verbose to me, though. It reads as book documentation and not comment, which may want to be more concise with a more telegraphic wording.
>>
>> Other may have different opinion though, I hope they can share it.
>>
>> --
>> http://mamot.fr/@drgeo
>>
>> --
>> Cuis-dev mailing list
>> Cuis-dev at lists.cuis.st
>> https://lists.cuis.st/mailman/listinfo/cuis-dev
>
> --
>
> R. Mark Volkmann
> Object Computing, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250406/41e975fb/attachment.htm>


More information about the Cuis-dev mailing list