Setting up Custom LookAndFeel class


#1

I am looking at making a custom LookAndFeel class, but wanted some advice on a few things.

  1. Where is the best place to store the class? I moved it to my JUCE projects folder, but I’m unsure if that’s the best spot and how to link all the headers? Absolute paths, or relative paths? I’m pretty new to linking files like this so any thoughts would be super helpful.

  2. I went and did a Find a Replace in the .h and .cpp for LookAndFeel with My_Custom_LookAndFeel… is this right?

Thanks in advance for any tips


#2

Dude hell NO!!! You don’t make your own custom look and feel by modifying the Juce sources…

You do it by creating a new instance of your derived LookAndFeel inside your JUCEApplication::initialise(), and calling LookAndFeel::setDefaultLookAndFeel() right after!!


#3

Sorry if the above post wasn’t clear, but that was my intention (to avoid modifying the JUCE source code files directly). I made a duplicate of the LookAndFeel class figuring I needed to make a custom version. Having done this, I wasn’t sure where to put it, etc. I knew that I had to call LookAndFeel::setDefaultLookAndFeel(), and pass in a custom version… but I’m unsure the best way to go about making the custom version.

You mention “You do it by creating a new instance of your derived LookAndFeel” , so should I:

  1. SubClass LookAndFeel and over ride the functions I want?
  2. Make a duplicate copy of the LookAndFeel .h and .cpp and modify that copy? If so, how to link and where to put?

Regardless of the correct approach, once I have my custom version I will do as you say and in the JUCEApplication::initialise(), call LookAndFeel::setDefaultLookAndFeel().

I started with the duplicate, but it seemed like possibly the wrong approach,… hence my post :slight_smile:


#4

You should be subclassing… I recently updated Nuance with a custom look and feel class if you want to take a look I can send it to you?


#5

Thanks Mr. Hochenjord. You rock!