<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <title></title>
  </head>
  <body bgcolor="#ffffff" text="#000000">
    On 8/24/2024 5:40 PM, Mark Volkmann via Cuis-dev wrote:
    <blockquote
cite="mid:CAFfRWnVX12f+G9-XL1R=pRaCmitCEG=S8ghCcS0guzRmdgi0-g@mail.gmail.com"
      type="cite">
      <div dir="ltr">I have a class whose <font face="monospace">initialize</font>
        method creates a <font face="monospace">TextModelMorph</font>
        like this:
        <div><br>
        </div>
        <div><font face="monospace">textModelMorph := TextModelMorph<br>
                textProvider: self<br>
                textGetter: #text<br>
                textSetter: #text:.</font><br>
          <div><br>
          </div>
          <div>It has the following additional instance methods:</div>
          <div><br>
          </div>
          <div><font face="monospace">text<br>
                  ^ text<br>
            </font></div>
          <div><font face="monospace"><br>
            </font></div>
          <div><font face="monospace">text: aString<br>
                  text := aString.</font></div>
          <div><br>
          </div>
          <div>In addition to displaying the <font face="monospace">TextModelMorph</font>,
            it displays a button.</div>
          <div>When the button is clicked, it does this:</div>
          <div><br>
          </div>
          <div><font face="monospace">self text: 'test'.</font></div>
          <div><br>
          </div>
          <div>But the <font face="monospace">TextModelMorph</font>
            does not update to show the new value.</div>
          <div>I thought since I changed the "model", it would update.</div>
          <div>I tried lots of methods in <font face="monospace">TextModelMorph</font>,
            such as <font face="monospace">updateActualContents</font>,
            but nothing is working.</div>
          <div>What do I need to do to cause it to update when the value
            of the text instance variable changes?</div>
          <div><br>
          </div>
          <div>--<br>
          </div>
          <div dir="ltr" class="gmail_signature"
            data-smartmail="gmail_signature">
            <div dir="ltr">
              <div>
                <div dir="ltr">
                  <div>
                    <div dir="ltr">
                      <div dir="ltr">
                        <div><font face="arial, helvetica, sans-serif">R.
                            Mark Volkmann</font></div>
                        <div><span style="font-size: 12.8px;"><font
                              face="arial, helvetica, sans-serif">Object
                              Computing, Inc.</font></span></div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    Hi Mark,<br>
    <br>
    I don't have access to your full example, so I can not try what I'll
    say. So take it just as a suggestion for further exploration.<br>
    <br>
    You need to do `self changed: #text.`. For an example, see senders
    of #classCommentText, especially in #newClassComment:. This is the
    changed: /update: dependency mechanism in action. According to MVC
    and the Observer pattern, models don't know about views, so they
    can't communicate directly. It is views, when created, that say 'I
    want to be notified when...'.<br>
    <br>
    Hope this helps,<br>
    <pre class="moz-signature" cols="72">-- 
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich</pre>
  </body>
</html>