[Q] handling complex selection

Martin Drautzburg martin.drautzburg at web.de
Mon Sep 1 13:37:37 UTC 2003


This is a general model/view question.

SearchResultView (model: SearchResult)
        AddressView (Address)
                AddressItemView (AddressItem)

I have a view (SearchResultView) that displays addresses. Each address
is displayed by an AddressView (with Address as model) and each
Address cosists of AddressItems (aStreet, aCity etc). Each AddressItem
is displayed by an AddressItemView. So an AddressView has
AddressItemViews as submorphs.

When the mouse hovers over an AddressView and/or an AddressItemView
the View shall be selected/highlighted. No problem so far.

Now I have *another* View (CategoryView) that should respond to the
currently selected AddressView and/or AddressItemView. I have a hard
time registering CategoryView as dependent of each
Address/ItemView. Think: anAddress might want to add another
AddressItem; it would then have to register the CategoryView as
dependent of the new AddressItem (or its view). This is clearly none
of its business.

What is the best way the get the information that a view is selected
out of a deeply nested submorph hierarchy ?



More information about the Squeak-dev mailing list