Model (MVP) ExerciseΒΆ

In the previous section we did not need to update the view. However, when changing the list of allowed line colour options it is better to update the model. The view should then be able to be updated by the presenter to only show the line colours allowed in the model. To achieve this you will need to add:

  1. A function to the model containing a list of allowed line colours and returning them when called. Does not need to be a method of the class

  2. A method in the view to update the ComboBox values to match some input values.

  3. In the initialisation of the presenter get the allowed colours from the model and pass them to the view.

See here for the solution.