<body><div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
                                        Hi, all! :-)<div><br></div><div>Thanks for the hints and suggestions. I fixed that in Morphic-mt.1613.</div><div><br></div><div>Happy new year!</div><div>Marcel</div><div class="mb_sig"></div><blockquote class="history_container" type="cite" style="border-left-style:solid;border-width:1px; margin-top:20px; margin-left:0px;padding-left:10px;">
                        <p style="color: #AAAAAA; margin-top: 10px;">Am 06.01.2020 02:03:13 schrieb David T. Lewis <lewis@mail.msen.com>:</p><div style="font-family:Arial,Helvetica,sans-serif">Sorry for replying to myself, but history aside I think that the<br>approach of changing #fitContents as suggested by both Stef and Karl<br>is probably best overall, because #fitContents is called whenever<br>the contents change, and rarely otherwise.<br><br><br>UpdatingStringMorph>>fitContents<br><br>      | newExtent |<br> newExtent := self measureContents.<br>    newExtent := ((newExtent x max: self minimumWidth) min: self maximumWidth) @ newExtent y.<br>     self extent = newExtent<br>               ifFalse: [self extent: newExtent].<br>    self changed. "contents have changed even if the extent remains the same"<br><br><br>Dave<br><br><br>On Sun, Jan 05, 2020 at 03:33:31PM -0500, David T. Lewis wrote:<br>> I don't know the best solution, but I checked change history to see where<br>> the problem originated.<br>> <br>> Prior to Morphic-mt.1512 of September 2019, UpdatingStringMorph<br>> implemented #contents: and the implementation sent #changed if the<br>> contents were changed.  Now we have #contents: only in the superclass<br>> StringMorph, and it does not send #changed:.<br>> <br>> Perhaps we should again override #contents: in UpdatingStringMorph<br>> to detect the change?<br>> <br>> UpdatingStringMorph>>contents: newContents <br>>  contents = newContents<br>>            ifTrue: [super contents: newContents]<br>>             ifFalse: [super contents: newContents.<br>>                    self changed]<br>> <br>> <br>> I note that the old version of UpdatingStringMorph>>contents: (method stamp<br>> aoy 2/17/2003) has this in its comment:<br>> <br>>    "This is the original StringMorph implementation of #contents:, restored<br>>     down in UpdatingStringMorph because a recent 'optimization' of the<br>>     StringMorph version of this method broke UpdatingStringMorphs."<br>> <br>> So it looks like the 2003 version was a bit of a hack to work around some<br>> previous problem, and the 2019 version got rid of the hack but lost the<br>> #changed notification.<br>> <br>> Dave<br>> <br>> On Sun, Jan 05, 2020 at 06:19:48PM +0100, karl ramberg wrote:<br>> > We should make fitContens a bit smarter/ dumber. It should send changed<br>> > even if extent is the same<br>> > <br>> > UpdatingStringMorph>>fitContents<br>> > <br>> > | newExtent |<br>> > newExtent := self measureContents.<br>> > newExtent := ((newExtent x max: self minimumWidth) min: self maximumWidth)<br>> > @ newExtent y.<br>> > (self extent = newExtent) ifFalse:<br>> > [self extent: newExtent.<br>> > self changed]<br>> > <br>> > Best,<br>> > Karl<br>> > <br>> > On Sun, Jan 5, 2020 at 6:06 PM St??phane Rollandin <lecteur@zogotounga.net><br>> > wrote:<br>> > <br>> > > Hello,<br>> > ><br>> > > As I already indicated one week ago, UpdatingStringMorph is currently<br>> > > broken in trunk.<br>> > ><br>> > > If you do<br>> > ><br>> > >    (UpdatingStringMorph on: Time selector: #now) openInWorld.<br>> > ><br>> > > you will see that the display is not consistently updated as it should<br>> > > via the #step method.<br>> > ><br>> > ><br>> > > This can be fixed by adding a #changed in StringMorph>>#contents: as<br>> > > follow:<br>> > ><br>> > ><br>> > > StringMorph>>#contents: newContents<br>> > ><br>> > >         newContents isText<br>> > >                 ifTrue: [^ self initializeFromText: newContents].<br>> > ><br>> > >         contents = newContents<br>> > >                 ifTrue: [^ self "no substantive change"].<br>> > ><br>> > >         contents := newContents.<br>> > ><br>> > >         self fitContents; changed<br>> > ><br>> > ><br>> > > Now maybe the #changed should be added to #fitContents itself.<br>> > ><br>> > > Stef<br>> > ><br>> > ><br>> <br>> > <br>> <br>> <br><br></lecteur@zogotounga.net></div></blockquote>
                                        </div></body>