Niko
It is possible to overlay new items into the Mozilla menus using your 
package's contents.rdf file to update the chrome registry. I am not sure 
if you can overwrite an existing item as easily, but I recall there 
being some discussion of a "deletes" or "replaces" attribute on the 
overlay element. Something like that. Hyatt? Somebody? If it is there, 
then it's a function of the overlay itself and its negotiating with the 
target menu. In general, the thing is to tell the chrome registry about 
an item in your package that needs to overlay a file in Mozilla. The 
following complete contents.rdf file, which would be included as part of 
your package and pointed to during that package's registration process, 
says, in effect (and in order):

* I have a new package here.
* Here is some detailed information about that package (e.g., it's 
called the "Mozilla Help System."
* I want some part of this package to overlay Mozilla's chrome (i.e., to 
be added to the content model described by "urn:mozilla:overlays").
* The information from my package I want to overlay there is in the 
overlay file chrome://help/content/TaskMenuOverlay.xul. This means that 
your package will be installed directly into the chrome directory and 
the files will be referenced from there.

This will put your new item in the Tasks menu. In general, any elements 
found in an overlay get added to the element in the target to which they 
correspond. In this case, the Help package's TaskMenuOverlay.xul file 
defines maybe a single item, and that item gets put into the Tasks menu. 
You can use the "position" attribute on the overlay to tell Mozilla 
where exactly to put the item. See the aging <a 
href="http://www.mozilla.org/xpfe/xptoolkit/overlays.html
">XUL Overlays</a> document for a little more information.

-ian

<?xml version="1.0"?>
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
          xmlns:chrome="http://www.mozilla.org/rdf/chrome#">

   <RDF:Seq about="urn:mozilla:package:root">
     <RDF:li resource="urn:mozilla:package:help"/>
   </RDF:Seq>

   <RDF:Description about="urn:mozilla:package:help"
         chrome:displayName="Mozilla Help System"
         chrome:author="helpful"
         chrome:name="help">
   </RDF:Description>

   <!-- Declare overlay target -->
   <RDF:Seq about="urn:mozilla:overlays">
     <RDF:li resource="chrome://communicator/content/tasksOverlay.xul"/>
   </RDF:Seq>

   <!--         Declare which of you files will overlay its information
        into the target file -->
   <RDF:Seq about="chrome://communicator/content/tasksOverlay.xul">
     <RDF:li>chrome://help/content/TaskMenuOverlay.xul</RDF:li>
   </RDF:Seq>

</RDF:RDF>


Niko Pavlicek wrote:

> German W. Bauer wrote:
> 
>> If you do not want to add a new application/package I would start by 
>> looking
>> how the Tasks menu is using overlays to adding itself to all windows.
> 
> 
>> You could then observe how the task menu is different between Mozilla and
>> Netscape, the latter using overlays on top of Mozilla's.
>> There is prob some trickiness to get your menu overlayed in the right 
>> order
>> over the others the are already being overlayed when using a normal 
>> install.
> 
> 
> ok, i'm searchin' for this possibility. Is it really possible to 
> override current overlays?
> 
> really gettin' frustrated with the docs at mozilla.org :-(
> 
> 
>> Niko Pavlicek wrote:
>> 
>> 
>>> Hello,
>>> I'm trying to create a new menu structure for mozilla. But there are
>>> several issues realizing this:
>>>     - do i have to register a new package?
>>>         - but then, how to get mozilla use the new package for the 
>>> menus?
>>>     - do i have to replace an old package?
>>>         - but then, does the user have to manually start mozilla with a
>>> command line option (-chrome chrome://my_menu_structure/content/)?
>>>         - and: do i have to copy not changed files of the old xuls in 
>>> the
>>> new package or can mozilla use the old ones?
>>> 
>>> I hope, anyone is able to answer these questions. thanx for all answers.
>>> 
>>> Regards,
>>>     Niko Pavlicek!
>>> 
>>> -- 
>>> Niko Pavlicek
>>> mailto:[EMAIL PROTECTED]
>>> ----------------------------
>> 


Reply via email to