On Feb 20, 4:47 am, mibtar <[email protected]> wrote:
> hi, i'm a bit new to this. but i'm having problems with styles,
> associating css files in particular.
>
> i'm using gwt 2.0 on firefox 3.5.7 and running on ubuntu.
>
> i created this class:
>
> public interface Resource extends ClientBundle{
>     public interface DefaultStyle extends CssResource{
>         public String menu();
>     }
>
>     @Source("defaultstyle.css")
>     public DefaultStyle defaultstyle();
>
> }
>
> defaultstyle.css contains:
>
> .menu{
>     padding:5px;
>     border-bottom:3px solid #c76df4;
>     border-left:1px solid #c76df4;
>     border-top:1px solid #c76df4;
>     border-right:3px solid #c76df4;
>     background-color:#EEEEEE;
>     color: #324971;
>
> }
>
> then i tried using the class:
>
> Resource resource = GWT.create(Resource.class);
> Label lbl = new Label("test");
> lbl.setStyleName(resource.defaultstyle().menu());
>
> simply doesn't work. i can't seem to figure it out, i've tried
> changing the class name
> in the css . but nothing seems to work.

Have you injected the CSS?
resource.defaultstyle().ensureInjected();

> also, does anyone have any idea why the widget are not using any
> styles? for example, when i create a button i just get a plain button
> and not like the button in the showcase.

The Showcase uses the themes bundled with GWT
(com.google.gwt.user.theme.standard.Standard being the "default" one)

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