1. #1
    Ext GWT Premium Member
    Join Date
    Jul 2010
    Posts
    34
    Vote Rating
    0
    PeterStrong is on a distinguished road

      0  

    Question Displaying an image in a ToolBar

    Displaying an image in a ToolBar


    I'm trying to find the easiest way to display a logo (with a transparent background) in a Toolbar that's being used as a status bar.

    I dropped in the following code:

    Code:
            ToolBar toolBar = new ToolBar();
            ImageResources ir = GWT.create(ImageResources.class);
    
            ContentPanel logo = new ContentPanel();
            logo.add(new Image(ir.logo));
            logo.setHeaderVisible(false);
            logo.setBodyBorder(false);
            
            toolBar.add(logo);
    The logo was displayed without difficulty, but the background shows up white:

    logoQuestion.png

    I used Firebug to try and determine why this was the case, but couldn't unravel what was going on. It appeared that the background was set to be transparent, but it certainly doesn't look that way.

    Any hints would be appreciated.

    Regards,

    Peter

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    I dont nderstand why you wrap the Image into a ContentPanel. Can you please explain this? That is also the reason why it has a white background.

  3. #3
    Ext GWT Premium Member
    Join Date
    Jul 2010
    Posts
    34
    Vote Rating
    0
    PeterStrong is on a distinguished road

      0  

    Default


    I've wrapped the Image because I can't add a com.google.gwt.user.client.ui.Image directly to the Toolbar - the add() method takes a com.extjs.gxt.ui.client.widget.Component.

    I'm using ClientBundles, so is there an easy way to create a Component from an ImageResource?

    I'm completely open to suggestions.

    Thanks!

  4. #4
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Code:
            toolBar.add(new WidgetComponent(new Image(ir.logo)));

  5. #5
    Ext GWT Premium Member
    Join Date
    Jul 2010
    Posts
    34
    Vote Rating
    0
    PeterStrong is on a distinguished road

      0  

    Default


    Excellent!

    Thanks Sven!

Similar Threads

  1. displaying image in panel
    By TheMonolith in forum Ext 3.x: Help & Discussion
    Replies: 9
    Last Post: 22 Feb 2010, 6:41 AM
  2. Displaying Image
    By rahesh in forum Ext 2.x: Help & Discussion
    Replies: 12
    Last Post: 6 Feb 2009, 2:28 AM
  3. Displaying Image in a Grid
    By sachinsurvase in forum Ext GWT: Help & Discussion (1.x)
    Replies: 3
    Last Post: 30 Sep 2008, 9:24 PM
  4. displaying image in TabPanel
    By JP_ExtJS in forum Ext 2.x: Help & Discussion
    Replies: 11
    Last Post: 11 Apr 2008, 9:58 AM
  5. Displaying image in Panel.
    By alks in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 16 Nov 2007, 4:31 AM

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi