Announcement

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

    Button Down Image

    I have an ImgButton that I would like to display one image while it's up and another while it's down.

    I have declared the button as such:

    ImgButton imgButton = new ImgButton();
    imgButton.setSize(16);
    imgButton.setSrc("oxygen/16/actions/media-playback-start.png");
    imgButton.setShowRollOver(false);
    imgButton.setActionType(SelectionType.CHECKBOX);

    Two questions here:

    1. How do I set the down image (css, method call, or other)?

    2. Why does the button by default remove the image set in setSrc() and replace it with a tiny whit square? (I have followed the example at http://www.smartclient.com/smartgwt/showcase/#buttons_category_toggle and the only difference I can see is that the buttons in the example are in a toolstrip.

    Thanks

    #2
    Reading the skinning guide, I learned that using an image by the same name as the source in setSrc() with _Down appended to the end should cause the button to show a different icon for different states. However, doing so has not done anything to the down state of my button

    I added an image called media-playback-start_Down.png and SmartGWT does not display the icon for the button in the down state.

    Comment


      #3
      There are flags on the component controlling whether distinct images are shown in different states - setShowRollover, setShowDown, etc. Also anytime an image is not showing up, use Firebug to see if theres a 404 - you might have a typo difference between the URL provided to the component and the name given to the saved image.

      Comment

      Working...
      X