[Cuis-dev] updating a TextModelMorph

Mark Volkmann r.mark.volkmann at gmail.com
Sat Aug 24 13:40:41 PDT 2024


I have a class whose initialize method creates a TextModelMorph like this:

textModelMorph := TextModelMorph
    textProvider: self
    textGetter: #text
    textSetter: #text:.

It has the following additional instance methods:

text
    ^ text

text: aString
    text := aString.

In addition to displaying the TextModelMorph, it displays a button.
When the button is clicked, it does this:

self text: 'test'.

But the TextModelMorph does not update to show the new value.
I thought since I changed the "model", it would update.
I tried lots of methods in TextModelMorph, such as updateActualContents,
but nothing is working.
What do I need to do to cause it to update when the value of the text
instance variable changes?

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


More information about the Cuis-dev mailing list