Observer pattern for ListBox and ListBoxModel


#1

I am missing an option to send a changed from a ListBoxModel to (all) connected ListBoxes.
Whenever my model changes, I find myself hacking around adding ChangeListeners or redundant references, just to call ListBox::updateContent() or ListBox::resized() to force updates.

Is there something, that I overlooked? Otherwise it would be great, if an internal ListenerList could be added to the ListBoxModel. It could act completely under the hood, no need to add a public ListBoxModel::Listener or something.

(I saw this old thread, but I think there are better solutions)


#2

I have always wondered as well why there is no default fireHasChanged in ListBoxModel that ListBox would listen to by default using some kind of ListBoxModelListener