[Project_owners] Persistant attribute in a <toolbar>

Michael Nachbaur mike at nachbaur.com
Fri Oct 7 10:27:28 EDT 2005


On Oct 7, 2005, at 1:49 AM, Neil wrote:

> Didier Ernotte wrote:
>
>> I have to create on-the-fly a toolbar in my extension, but it's  
>> created, I want to keep the visible/hidden attribute manually set  
>> by the user in the menu "view > toolbars". I guess I have to set  
>> the "persist" on my toolbar, but what attribute to persists ? the  
>> "hidden" ? the "collapsed", or an other ?
>>
> You can't persist attributes on dynamically created elements. At  
> least in SeaMonkey, goToggleToolbar handles all the necessary  
> persistence itself.
>

If you are building your toolbar dynamically, you can just track what  
changes are made to the toolbar and store those in the user prefs or  
in rdf:local-store.

How do you build your toolbar, by the way?  How do you decide which  
buttons, labels, etc to create?  If you store the definitions for the  
toolbar in RDF, then it could be possible to store the definitions  
for persistance in there as well, and can build your toolbar using  
XUL templates.

I do something very similar (not with a toolbar, but with a side- 
panel of buttons).



More information about the Project_owners mailing list