LookAndFeel_V4::initialiseColours() not virtual


in LookAndFeel_V4 you first set your ColourScheme and then initialiseColours() will spread the ColourScheme colours to all colourIDs. I would like to edit some of that behaviour in my subclass but this method is not virtual. Furthermore, currentColourScheme is a private member of LookAndFeel_V4

Does someone has a smart idea how to achieve this without the need of rewriting LookAndFeel_V4 ?


I can’t think of a great way to do this. The best I can think of is to write a function like this in your derived class, and to call this function from the constructor:

void setColourSchemeModified (ColourScheme cs)
    setColourScheme (cs);
    // you can read cs here and call setColour as appropriate

It wouldn’t be a good idea to make initialiseColours virtual, because it is called from the constructor. See the Core Guidelines for details.

1 Like

Oh, good point. Haven’t thought about that.

Alright, that’s what I’m already doing now. It looked a bit unefficient to me to first call setColourScheme (with initialiseColours() afterwards) on the base class and then doing almost the same again with my settings…

Thanks for the fast reply! :+1: