Example 3     <<      >>      book     

Several menuitems can be grouped together. The menuitems in the same group has the same value of name attribute. The click on the menu item selects it. The further behaviour depends on the value of type attribute.

  XUL  HOME     

  xul1.xul  
If the type is equal to "radio", only one member of the group can be simultaneously selected. A selection of a new item automatically unselects the original one.
<?xml-stylesheet href="css1.css" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
align="vertical" >
     <menubar>
          <menu value="AAA">
               <menupopup>
                    <menuitem type="radio" name="gr1" value="aaa"/>
                    <menuitem type="radio" name="gr1" value="bbb"/>
                    <menuitem type="radio" name="gr1" value="ccc"/>
                    <menuseparator/>
                    <menuitem type="radio" name="gr2" value="111"/>
                    <menuitem type="radio" name="gr2" value="222"/>
                    <menuitem type="radio" name="gr2" value="333"/>
               </menupopup>
          </menu>
     </menubar>
</window>

  xul2.xul  
If the type is equal to "checkbox", several members of the group can be simultaneously selected.
<?xml-stylesheet href="css1.css" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
align="vertical" >
     <menubar>
          <menu value="AAA">
               <menupopup>
                    <menuitem type="checkbox" name="gr1" value="aaa"/>
                    <menuitem type="checkbox" name="gr1" value="bbb"/>
                    <menuitem type="checkbox" name="gr1" value="ccc"/>
                    <menuseparator/>
                    <menuitem type="checkbox" name="gr2" value="111"/>
                    <menuitem type="checkbox" name="gr2" value="222"/>
                    <menuitem type="checkbox" name="gr2" value="333"/>
               </menupopup>
          </menu>
     </menubar>
</window>

  xul3.xul  
The checked attribute equal to "true" selects the item at the startup
<?xml-stylesheet href="css1.css" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
align="vertical" >
     <menubar>
          <menu value="AAA">
               <menupopup>
                    <menuitem type="radio" name="gr1" value="aaa" checked="true"/>
                    <menuitem type="radio" name="gr1" value="bbb"/>
                    <menuitem type="radio" name="gr1" value="ccc"/>
                    <menuseparator/>
                    <menuitem type="checkbox" name="gr2" value="111"/>
                    <menuitem type="checkbox" name="gr2" value="222" checked="true"/>
                    <menuitem type="checkbox" name="gr2" value="333" checked="true"/>
               </menupopup>
          </menu>
     </menubar>
</window>

  CSS  HOME     

  css1.css  
The default Mozilla CSS is used.
@import url(chrome://global/skin);