Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Img in Toolstrip

    I'm a Smart GWT 3.1 Power Edition user. I'm trying to place an Img in a class that extends Toolstrip. I don't want to set the width and height explicitly as I won't always know them. I'm using code similar to the following in my Toolstrip's constructor:

    Img imageLabel = new Img();
    imageLabel.setImageType(ImageStyle.NORMAL);
    imageLabel.setSrc("icons/icon.png");
    addMember(imageLabel);

    However, the icon image is being cut off. If I set an explicit width and height on the Img then it works. Am I doing something wrong?

    #2
    We can't auto-size automatically to this image because it's potentially not loaded yet - the browser can tell us the size. You can use the core GWT Image class to discover the size and provide the right size to the SmartGWT component.

    Comment

    Working...
    X