I want to add images to Toolbar in gwtext using ImageBundle

ImageBundle is working fine when adding images to the panel,
but when adding to the ToolbarButton its not supporting,
how can i add images to ToolbarButton?

below is my code.

package org.gwt.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Image;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.Toolbar;
import com.gwtext.client.widgets.ToolbarButton;
import com.gwtext.client.widgets.Viewport;
import com.gwtext.client.widgets.form.Label;
import org.gwt.client.Image.RichTextToolbar.Images;

/**
 *
 * @author Administrator
 */
public class ImagesExBundle implements EntryPoint {
 private Images images = (Images) GWT.create(Images.class);
  public void onModuleLoad() {
  Panel mainPanel=new Panel();
  mainPanel.setHeight(450);
  mainPanel.setWidth(350);
  Label lbl=new Label("hi GWT");
  mainPanel.setBodyStyle("background-color:olive");
  mainPanel.add(lbl);

  //
  AbstractImagePrototype graphic1 =images.createLink();
  Image img1 = graphic1.createImage();
  mainPanel.add(img1);
  AbstractImagePrototype graphic2 =images.hr();
  Image img2 = graphic2.createImage();
  mainPanel.add(img2);
  Toolbar toolbar = new Toolbar();
  ToolbarButton menuButton = new ToolbarButton();
  menuButton.add(img2);   // iam facing problem here
  toolbar.add(menuButton);

  toolbar.addSeparator();
  mainpanel.add(toolbar);

  Viewport vport=new Viewport(mainPanel);

    }

}
thanks in advance
PDVPRASAD
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"GWT-Ext Developer Forum" 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/gwt-ext?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to