[Project_owners] mozilla/seamonkey and toolbar buttons

Michael Vincent van Rantwijk mv_van_rantwijk at SPAMFREEyahoo.com
Tue Jun 21 23:50:08 EDT 2005

Eric Jung wrote:
> Hi,
> I've added a toolbar button to the Mozilla navbar like so:
> <hbox id="nav-bar-buttons">
>   <toolbarbutton id="pwdmaker-btn" tooltiptext="Open PasswordMaker"
>     oncommand="passwordMaker.open();" persist="hidden"
>     class="toolbarbutton-1"
>     image="chrome://passwdmaker/skin/passwdmaker.png"/>
> </hbox>
> But I have two problems:
> 1. the image doesn't appear

Try this:

<hbox id="nav-bar-buttons">
   <toolbarbutton id="pwdmaker-btn" class="toolbarbutton-1" 
tooltiptext="Open PasswordMaker"
                  oncommand="passwordMaker.open();" persist="hidden">
     <image src="chrome://passwdmaker/skin/passwdmaker.png"/>

But you better use something like this:

#pwdmaker-btn {
   list-style-image: url("chrome://passwdmaker/skin/passwdmaker.png")

in your stylsheet, instead of the hard coded URI.

BTW; is 'passwdmaker' the exact chrome name?
Also, what happens when you paste the URI in the location bar?

> 2. when I right-click on the navbar, there's no open to hide the
> button.

You must add context="someMenupopupID" or add you're own JS code to 
display the popup, which is exactly what we do btw.


More information about the Project_owners mailing list