<html><head></head><body><div dir="auto">TextModel generates some events. Browse senders of #changed: to see it. Maybe the event that #addDepedent: listens to is not the one you need.<br><br>Cuis use the Observer Pattern as a dependency mechanism (see [1]) so #addDependent: and #changed: are "simplifications" of #when:send:to: and #triggerEvent:with:<br><br>IMHO if what you need is to be notified of changes in the model, I'd use it directly instead of making TextModelMorph notify me.<br><br>1 - <<a href="https://github.com/nmingotti/The-Cuis-CookBook/wiki/The-Dependency-Mechanism--3">https://github.com/nmingotti/The-Cuis-CookBook/wiki/The-Dependency-Mechanism--3</a>></div><br><br><div class="gmail_quote"><div dir="auto">Em 23 de março de 2025 11:53:10 BRT, Mark Volkmann via Cuis-dev <cuis-dev@lists.cuis.st> escreveu:</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div dir="ltr">As far as I can tell,<span class="gmail-Apple-converted-space"> </span><font face="monospace">TextModel</font><span class="gmail-Apple-converted-space"> </span>morph does not send<span class="gmail-Apple-converted-space"> </span><font face="monospace">#changed:</font><span class="gmail-Apple-converted-space"> </span>every time its value changes, so that prevents me from listening for updates. I see that the <font face="monospace">TextModel</font><span class="gmail-Apple-converted-space"> </span>method<span class="gmail-Apple-converted-space"> </span><font face="monospace">actualContents:</font><span class="gmail-Apple-converted-space"> </span>does send<span class="gmail-Apple-converted-space"> </span><font face="monospace">#changed:</font>, but that is not invoked on every change to a<span class="gmail-Apple-converted-space"> </span><font face="monospace">TextModelMorph</font><span class="gmail-Apple-converted-space"> </span>even when it is configured with<span class="gmail-Apple-converted-space"> </span><font face="monospace">acceptOnAny: true</font>.<br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Sun, Mar 23, 2025 at 9:38 AM <<a href="mailto:ken.dickey@whidbey.com">ken.dickey@whidbey.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">On 2025-03-23 06:35, Mark Volkmann via Cuis-dev wrote:<br>
<br>
> ...<br>
> myTextModelMorph addDependent: self.<br>
..<br>
> <br>
> I have a few questions.<br>
> - Are there reasons why I should not want this ability?<br>
<br>
Generally, Morphs are Views and update to reflect changes in an <br>
underlying Model.<br>
<br>
A Morph can be a Model if sensible.<br>
<br>
> - Would it be better to listen for changes on the underlying TextModel?<br>
<br>
IMHO, yes.<br>
<br>
$0.02,<br>
-KenD<br>
</blockquote></div><div><br clear="all"></div><div><br></div></blockquote></div><div dir="auto"><br>--<br>Att.<br>Wéslleymberg Lisboa<br>Graduado em Sistemas de Informação<br>Docente no IFFluminense - Campus Itaboraí<br>Ex-Bolsista de IC do Núcleo de Computação Científica (NC2-IFF) - Projeto IFF Aerospace<br>Github: <a href="https://github.com/weslleymberg">https://github.com/weslleymberg</a><br>Tel.: +55 22 99931-2376</div></body></html>