Thanks Dave,

That will probably do the trick.

Somehow I had hoped that

<ui:with field="res" type="com.mycompany.MyClientBundle"/>
<ui:style>
.myClass {
    background-image=url('res.myImage');
}
</ui:style>

would have been enough - so much less typing! Anyone from the Dev Team
reading this?? ;)

Cheers

Mike

On Mar 10, 7:10 pm, davidroe <[email protected]> wrote:
> this is how I did it.
>
> in whatever.css:
>
> @sprite .myClass {
>   gwt-image: "myImage";
>   width: auto; height: auto;
>   background-repeat: repeat;
>   background-position: 0% 0%;
>
> }
>
> in Resources.java:
>
> public interface Resources extends ClientBundle {
>
>   ...
>
>   public interface WhateverCss extends CssResource {
>     String myClass();
>   }
>
>   @Source("com/whoever/client/resources/whatever.css")
>   public WhateverCss whateverCss();
>
> }
>
> in WhateverClass.ui.xml:
>
>   <ui:with field="res" type="com.whoever.client.resources.Resources" /
>
>
>
>   <div class="{res.whateverCss.myClass}">
>
> HTH,
> /dave
>
> On Mar 10, 8:52 am, Michael <[email protected]> wrote:
>
> > Hi there,
>
> > I'm having a go at using the declarative layout and was wondering if
> > there's a way of using an image declared in a ClientBundle as a
> > background-image in the ui:style section, thus:
>
> > <ui:UiBinder
> >   xmlns:ui="urn:ui:com.google.gwt.uibinder"
> >   xmlns:g="urn:import:com.google.gwt.user.client.ui">
> >         <ui:with field="res" type="com.mycompany.MyClientBundle"/>
>
> >         <ui:style>
> >                 .banner {
> >                         background-image:url('res.menuBackground');
> >                 }
> >         </ui:style>
> > </ui:UiBinder>
>
> > If not, how are you supposed to do that?
>
> > Cheers
>
> > Mike

-- 
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