More than 1 LookAndFeel?


#1

Hi all,

I’m writing a simple app that will allow the user to switch between different slider appearances. To do this, I have set up a combobox with values of “Default”, “Type1”, “Type2” etc…
I can get a new LookAndFeel working but how can I implement this so it will respond to the user’s choice. I’m using various image strips created in Knobman. I can see that the demo allows you to choose between 2 skins from the menu but I can’t get my head around how it works!

Thanks for any help…


#2

[quote=“omen”]
I can get a new LookAndFeel working but how can I implement this so it will respond to the user’s choice.[/quote]
The comboBoxChanged() callback from ComboBox::Listener should work here.

Chris


#3

Thanks Chris. Although I need to figure out how to associate more than one slider image to the drawRotarySlider () method. So for example I have the combobox with 10 options for the lookandfeel. When the user selects one it should show the relevant slider appearance. I can get it working switching between default and one other custom l+f. But how do I have more than one custom l+f without having multiple drawRotarySlider () methods?

Thanks…


#4

Component::setLookAndFeel().


#5

Ok think I got that much working. Is it possible though to change a rotary slider without changing the other widgets? When I use Component::setLookAndFeel() it changes all widgets on that component.


#6

The slider is a component, so just do slider->setLookAndFeel()


#7

Thanks Graeme for the simple solution!