[Cuis-dev] TextEntryMorph content: method

Mark Volkmann r.mark.volkmann at gmail.com
Sat Aug 10 16:57:25 PDT 2024


In my app I display a TextEntryMorph whose morphExtent is set to a specific
width.
The user enters text and clicks a button that adds the text to a list.
The code then clears the TextEntryMorph by setting its content to an empty
string.
The TextEntryMorph contents: methods ends when these lines:

self fitContents.
self redrawNeeded

This discards the width I set initially.
I can fix this with the following:

ext := todoEntry morphExtent.
todoEntry contents: ''.
todoEntry morphExtent: ext.

Does it seem desirable for a text input to change its width based on its
contents?
I know that wouldn't normally happen in an HTML input element seen in a
web-based form.

I realize that I can add a new method to TextEntryMorph that does what
contents: does and excludes those lines. I'm just surprised by the current
default behavior.

-- 
R. Mark Volkmann
Object Computing, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240810/5fc01f22/attachment.htm>


More information about the Cuis-dev mailing list