[Project_owners] Hide statusbar icon

Michael Vincent van Rantwijk, MultiZilla mv_van_rantwijk at yahoo.com
Sun Sep 16 15:39:45 PDT 2007


Neil wrote:
> Michael Vincent van Rantwijk, MultiZilla wrote:
> 
>> Christian Arnold wrote:
>>
>>> function statusbarIcon(iconVisible) {
>>>     var wm = 
>>> Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator); 
>>>
>>>     var type = 'navigator:browser'
>>>     var enumerator = wm.getEnumerator(type);
>>>     while(enumerator.hasMoreElements()) {
>>>         var win = enumerator.getNext();
>>>         var panel = 
>>> win.document.getElementById("your-extension-statusbarpanel");
>>>         panel.hidden = iconVisible;
>>>     }
>>> }
>>>
>>> The XUL-Part:
>>> <checkbox id="prefstatusbarvisible" preference="statusbarvisible" 
>>> label="&prefstatusbarvisible.label;" onclick="return 
>>> statusbarIcon(this.checked);"/>
>>
>> Don't use code like this, but use the observer service to notify all 
>> open windows.
> 
> Better still, use the preference service - you are after all setting 
> preferences...

Ah, now I see (I had missed this before with my sleepy eyes/head).

Thanks,

-- 
Michael Vincent van Rantwijk
- MultiZilla Project Team Lead
- XUL Boot Camp Staff member (ActiveState Training Partner)
- iPhone Application Developer


More information about the Project_owners mailing list