Icons On Buttons

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Icons On Buttons

gaurav-32
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
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|

Re: Icons On Buttons

dave fletcher-2
Here's how I do it, simple example. "image" attribute, and I put the
file in my skin chrome directory.

Cheers,

--fletch


https://github.com/dfletcher/noooooooo/blob/master/content/overlay.xul

On Sun, May 6, 2012 at 12:27 PM, gaurav <[hidden email]> 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
> _______________________________________________
> dev-tech-xul mailing list
> [hidden email]
> https://lists.mozilla.org/listinfo/dev-tech-xul
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|

Re: Icons On Buttons

Neil-4
In reply to this post by gaurav-32
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.
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul