Are you doing this in a subclass of ScrollPane? If so, you could also define a
custom subclass of ScrollPaneSkin that calls setBackgroundColor(10) in its
constructor. We do something similar with some of the other Terra skins such as
TerraBoxPaneSkin.
On Jun 10, 2011, at 7:53 AM, Chris Bartlett wrote:
> scrollPane.getStyles().put("backgroundColor", 10);
>
> On 10 June 2011 18:46, Edvin Syse <[email protected]> wrote:
> In some cases I want to change the backgroundColor of a ScrollPane. I do it
> like this:
>
> ScrollPaneSkin skin = (ScrollPaneSkin) getSkin();
> TerraTheme theme = (TerraTheme) Theme.getTheme();
> skin.setBackgroundColor(theme.getColor(10));
>
> I don't care that I reference the TerraTheme directly, but apart from that -
> is this a good way to do it?
>
> -- Edvin
>
>
>