Costas,
> After reading about MVC/MVP my understanding is that you can have a
> model with many view/controllers wired to it. (The simple concept)
>
> Models send #changed messages and dependent views receive them as
> #update and then request model data for subsequent display.
>
> Now the problem. I have one view but have many models (actually they
> are the same model class, but many instances). I will be displaying
> changes in the models as they happen in a scrollable listbox control.
You can probably think about this as multiple items in a ListModel that
becomes the model to a ListPresenter. The biggest problem you'll have is
updating the appearance of the list, and that can be done via a ListModel (I
think) method that's something like #updateItemAtIndex:(????). One way to
do it would be to register interest in events triggered by or about the
items such that they are sent to the parent presenter, and have it lookup
the index and do the updates. If you have many such list presenters, you
might consider subclassing ListPresenter to add the lookup/update
functionality. Perhaps somebody has a more elegant suggestion.
Beware problems in Windows' handling of control notifications. You _might
find that you'll need to use #queueDeferredAction: to make the actual
updates. A search of Ian's archives should turn up the conditions under
which this can be an issue.
Have a good one,
Bill
--
Wilhelm K. Schwab, Ph.D.
[hidden email]