I’m just trying to code a quick tool using ListBoxes, but I’m a little bit confused about how the GUI gets notified when the user selects another item in the List.
Basically my (very simple) app is divided in a Model and a View/Controler (a basic MVC). I have a ListBox in the view, and a ListBoxModel in the Model.
If I change the selection in the ListBox, the ListBoxModel is notified inside the overrided selectedRowsChanged . However, how can I make the other GUI classes aware of a change of selection ?
In MVC, the model (ListBoxModel in that case) is not supposed to be aware of any GUI class at all, so I can’t call a method from the GUI from ListBoxModel.
I couldn’t find any method in ListBox, that I can override to be notified when the selection changed, and looking at the code, it doesn’t seem to exist any.
What’s the recomended way of doing such things ?