<div dir="ltr"><div>I would like to be able to use the dependency mechanism to be notified about changes to the value of a <font face="monospace">TextModelMorph</font>. I've discovered that I can get this if I add the following line to the <font face="monospace">acceptContents</font> method of <font face="monospace">InnerTextMorph</font> after the variable <font face="monospace">accepted</font> is set:</div><div><br></div><div><font face="monospace">accepted class = TextModel ifTrue: [ owner changed: owner ].<br></font></div><div><br></div><div>In a class that creates a <font face="monospace">TextModelMorph</font> I can then do this:</div><div><br></div><div><font face="monospace">myTextModelMorph addDependent: self.</font></div><div><br></div><div>Then I can add an <font face="monospace">update:</font> method to that class like this:</div><div><br></div><div><font face="monospace">update: sender<br>    sender = myTextModelMorph ifTrue: [</font></div><div><font face="monospace">        | value |<br>        value := sender model actualContents asString.<br>        'value is now ', value :: print<br>    ].</font><br><br></div><div>I have a few questions.</div><div>- Are there reasons why I should not want this ability?</div><div>- Is there a better way to achieve this that doesn't require modifying InnerTextMorph?</div><div>- Would it be better to listen for changes on the underlying <font face="monospace">TextModel</font>?</div><div>  I couldn't find a way to get that to work either without modifying that class.</div><div><br></div><div>I attached a changeset in case the change to InnerTextMorph seems desirable.</div><div><br></div><span class="gmail_signature_prefix">-- </span><br><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.8000001907349px"><font face="arial, helvetica, sans-serif">Object Computing, Inc.</font></span></div></div></div></div></div></div></div></div></div>