[squeak-dev] [BUG] Updating TheWorldMainDockingBar leaves dangling results widgets

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Wed Jan 22 08:55:27 UTC 2020


Steps to reproduce:

Go to the SearchBar of TWMDB (TheWorldMainDockingBar) and print something.

Update TWMBB, for example by applying a UI theme.

In the SearchBar, print another thing.


Expected behavior:

There is still one results widget displaying the result of your latest expression.


Actual behavior:

The first results widget keeps open and will be never closed.


Considerations:

SearchBar, which is a model, stores the results widget, which is a morph. Via #removeResultsWidget, the latter is removed if a new expression is printed.

But in TWMDB>>#searchBarOn:, which is called by #updatedIfNeeded:, each time a new SearchBar is created and built. This SearchBar is not referenced by TWMDB or the DockingBarMorph, but only as the model of the PluggableTextMorphPlus for the search bar. This text morph, in turn, is deleted by #updateIfNeeded: per "aDockingBar removeAllMorphs". But as the text morph is directly composed into the world, it is not affected by that deletion.


Solution approaches:

a. Store the SearchBar model instance in TWMDB? Contra: TWMDB should keep able to work with an arbitrary number of docking bar morphs.

b. Store the SearchBar model instance in DockingBarMorph? Contra: handling the search rather seems a responsibility of TWMDB.

I am a bit confused about the current design ...


Best,

Christoph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200122/97dc81a9/attachment.html>


More information about the Squeak-dev mailing list