Notification of changeBackgroundColor


#1

It seems to me that the following feature is missing in the code provided in the book:
When the user of the program resets the preferences (including the background color of the table), that should trigger a notification as well, so that the color is updated in each document window.
In my case that is not happening and I followed the book since the beginning.

That is, of course, not difficult to implement, but I’m not sure the way I did it is really ok.
Apparently it works, like this:
I moved all the notification code from

to a new method:

Then I replaced its previous occurrence with

in

and added the following

in the last line of

With this last line I’m repeating code, which doesn’t seem very elegant, and perhaps can lead to a situation in which I could change it in one method and forget to do it in the other method, but it seems to me that that is the only problem that might arise.

best regards
agostinho