public interface MessagePanelClientBundle extends ClientBundle {

       @Source("message-panel.css")
       MessagePanelCSS css();

       @Source("error.png")
       DataResource error();
}

css:
@url errorUrl error;
.error {
 background-image: 'errorUrl';
}

2010/8/10 Joe Hudson <[email protected]>

> It turns out I was just being dumb :)
>
> I'll post the fix below but I've also got another question.  I want
> the component to have a background image but I do not want the size to
> be restricted to the width and height of the background image.  Can
> anyone tell me how to do this?
>
> I'm looking here:
> http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.html#CssResource
> but don't see any reference to that.  Thanks.
>
> Joe
>
> And the fix is that the @sprite is declared on the css style
> definition where an image is used.  I was thinking that the @sprite
> create an image definition to be used in other styles later.
>
> --- CSS file
> @sprite .errorMessage {
>    background-color: #FEEFB3;
>    gwt-image: 'error';
>
> }
>
>
> On Aug 9, 11:40 pm, Joe Hudson <[email protected]> wrote:
> > Hi,
> >
> > I'm trying to use a css bundle with a background image reference and I
> > am getting an error in the Development Mode Eclipse view:  Fix by
> > adding String accessor method(s) to the CssResource interface for
> > obfuscated classes, or using an @external declaration for unobfuscated
> > classes.
> >
> > When I add an @external at-rule I no longer receive the error but the
> > background image doesn't show up.  More specifically, I do see all
> > other css attributes when inspecting the DOM but just not the
> > background-image attribute.
> >
> > Here is my code (snipped for readability)
> >
> > --- CSS file
> > @sprite .error {
> >   gwt-image: 'error';
> >
> > }
> >
> > .errorMessage {
> >     background-color: #FEEFB3;
> >     gwt-image: 'warn';
> >
> > }
> >
> > -- Client Bundle
> > public interface MessagePanelClientBundle extends ClientBundle {
> >
> >         @Source("message-panel.css")
> >         MessagePanelCSS css();
> >
> >         @Source("error.png")
> >         ImageResource error();
> >
> > }
> >
> > -- Css Bundle
> > public interface MessagePanelCSS extends CssResource {
> >
> >         String errorMessage();
> >
> > }
> >
> > Does anyone have any ideas as to why this might happen?  Any help
> > would be appreciated.  Thanks.
> >
> > Joe
>
> --
> 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]<google-web-toolkit%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>

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