On 4 oct, 01:41, AndyB <[email protected]> wrote:
> I know it is possible, as it is done in the showcase example.
>
> I have tried looking through the code for the example but it is
> somewhat confounding.
>
> What I am interested in doing is changing the GWT user interface
> theme, the one that is inherited from the module XML, at runtime.
> I was wondering if someone could give me some quick step instructions
> into switching between Standard/Crome/Dark at runtime?

The keys are:
1. inherit the themeResources module (not theme module) [1], so you
can control which stylesheet gets injected (as you have to inject it
yourself)
2. to switch themes, remove the current theme's stylesheet and inject
the new theme's one. Showcase uses a StyleSheetLoader helper class [2]
to update the theme [3]

[1]
http://code.google.com/p/google-web-toolkit/source/browse/releases/1.6/samples/showcase/src/com/google/gwt/sample/showcase/Showcase.gwt.xml#6
[2]
http://code.google.com/p/google-web-toolkit/source/browse/releases/1.6/samples/showcase/src/com/google/gwt/sample/showcase/client/StyleSheetLoader.java
[3]
http://code.google.com/p/google-web-toolkit/source/browse/releases/1.6/samples/showcase/src/com/google/gwt/sample/showcase/client/Showcase.java#505

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to