Re: Icons On Buttons

Neil <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xpfe
Message-ID <[email protected]>
gaurav wrote:

>i just learn to create firefox extension. And im able to create a very basic firefox extension with few buttons in it. But i could not find a way to add an ICON on my buttons.
>
>Anyone please help me how can i add icon on my buttons?
>
>      <toolbarbutton id="myButton"
>        label="Home" oncommand="myHome(event)" />
>
>above code redirects user to my website home page. But i want to add an icon on my buttons
>  
>
The recommended way is to use css in your skin:
#myButton {
    list-style-image: url(chrome://myext/skin/home.png);
}

You can then add extra versions e.g. for when the button is disabled:
#myButton[disabled="true"] {
    list-style-image: url(chrome://myext/skin/home-dis.png);
}

-- 
Warning: May contain traces of nuts.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.