apply a new theme at any time.

I am looking for a way to apply setTheme() at anytime … for example I would like to apply a setTheme into the addListener of a button.

How can I do that ? It seems that the result does not apply unless the application is manually refreshed from the browser button.

I did partially solved it.
I was trying to set a theme based on client browser resolution and I was doing a setTheme() before window was attached to the tree.

To solve this I moved the setTheme() into the attach() overridden method and now I could get the browser information but not the screen resolution.

This can already help to make some importnat decision on what Theme to use but it seems to early to detect the client device width and height.