PDA

View Full Version : Button with icon



nks14
8 Sep 2009, 1:46 AM
hello. i want to create a button with a big image + text. something like http://www.extjs.com/examples/#buttons (in Menu Buttons -> icon and text top)

my code for the button is


Button create = new Button("Adauga");
create.setIconStyle("test");
create.setSize(60,60);
create.setIconAlign(IconAlign.TOP);and my css is


.test {
background:url(../images/search_0.png) no-repeat center center !important;
width: 60px !important;
height: 60px !important;
}all i get is a stupid alignet button ... you can check the image attached.
can you please help me?

the "search_0.png" image is bigger as you can see.

oxyrox
14 Jul 2010, 1:29 AM
Hi nks14,

It's been a while since you posted this, but maybe someone else has the same problem.

I solved this one by creating an icon using the IconHelper of GXT:

button.setIcon(IconHelper.createStyle("test", 60, 60));
Note: It's possible that you'll have to adjust some css... I remember that Safari & Chrome still cut the icon after this...

Greets,
oxy