[SOLVED] StablexUI add icon to button

I am unable to find info on how to add an icon image to a button in StablexUI:

UIBuilder.create(Button, {
									    right : 0,
								        top  : 100,
								        widthPt: 10,
								        h: 40,
								        text : 'Save',
								        id:"saveRowButton"+itemsCounter,
								       
								        formatColor: '0xFFFFFF',
								        align: "center,middle",
								        ico:  Assets.getBitmapData("assets/img/save_filled_50.png"),
								           
								       skinName : "removeItem",
								       
								})

I tried using ico: bitmapFromAssets but I get an error. I can’t find an example on how to do this. Thanks in advance for your help.

Hey Frank, what I usually use is the xml file where you can add icons this way:

<Button leftPt="2" ico-bitmapData="Assets.getBitmapData('img/states/help/clicked.png')"/>

I tried to do it by hx file but it didn’t work that well:
var button:Button = UIBuilder.create(Button,
{left: 100, top : 100, w: 300, h: 200,
id:‘saveRowButton’, formatColor: ‘0x000000’,
align: ‘center,middle’,
icoBitmapData : Assets.getBitmapData(‘img/states/help/hexagonal.png’)
});

1 Like

Anyway i let you where to find the documentation:
http://ui.stablex.ru/doc/#ru/stablex/ui/widgets/Button.html

1 Like