setColour not working on Viewport Sliders

Since the default vertical slider comes up as almost black on black and almost invisible, I’m trying to set the colours to match the other sliders in use. I have tried:

		ScrollBar *sb = TrackView.getVerticalScrollBar();
		if(sb == 0){
			AlertWindow::showMessageBox	(	AlertWindow::InfoIcon, "Alert", "Scroll Bar Null" );
		}
		sb->setColour (Slider::backgroundColourId, Colours::white);
		sb->setColour (Slider::thumbColourId, Colour (0xff171741));
		sb->setColour (Slider::trackColourId, Colours::grey);

I get a valid pointer back, but setColour has no effect. I call this after creating the viewport and then again after the component it contains grows enough so the slider is visible (and every addition after that).
How can I reset the Viewport Slider colours?

A Scrollbar isn’t a Slider

m_ViewPort.getHorizontalScrollBar()->setColour (ScrollBar::thumbColourId, Colours::silver);

and you only need to set it once.

Rail

1 Like

Duh! I should be more careful.
Thanks!

Allthough the thumbColourId does work, the others seem to not have any effect…

stepViewsContainerScrollView.getVerticalScrollBar().setColour(ScrollBar::trackColourId, Colours::yellow);
stepViewsContainerScrollView.getVerticalScrollBar().setColour(ScrollBar::backgroundColourId, Colours::orange);

Why is that?