Visit Mozilla.org

XUL:menubar

From MDC

« XUL Reference home    [ Examples | Attributes | Properties | Methods | Related ]

A container that usually contains menu elements. On the Macintosh, the menubar is displayed along the top of the screen, and all non-menu related elements inside the menubar will be ignored.

More information is available in the XUL tutorial.

Attributes
grippyhidden, statusbar
Properties
accessibleType, statusbar

[edit] Examples

Image:XUL_ref_menu.png
<menubar id="sample-menubar">
  <menu id="action-menu" label="Action">
    <menupopup id="action-popup">
      <menuitem label="New"/>
      <menuitem label="Save" disabled="true"/>
      <menuitem label="Close"/>
      <menuseparator/>
      <menuitem label="Quit"/>
    </menupopup>
  </menu>
  <menu id="edit-menu" label="Edit">
    <menupopup id="edit-popup">
      <menuitem label="Undo"/>
      <menuitem label="Redo"/>
    </menupopup>
  </menu>
</menubar>

[edit] Attributes

Inherited from XUL element
align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width

grippyhidden
Not in Firefox
Type: boolean
When set to true, the grippy will be hidden. When set to false, the default, the grippy will be shown.

statusbar
Type: id of statusbar element
If you set this attribute to the id of a statusbar element, the label on the statusbar will update to the statustext of the items on the menu as the user moves the mouse over them.

[edit] Properties

accessibleType
Type: integer
A value indicating the type of accessibility object for the element.

statusbar
Type: id of statusbar element
Gets and sets the value of the statusbar attribute.

Inherited from XUL element
align, allowEvents, boxObject, builder, className, collapsed, contextMenu, controllers, currentItem, database, datasources, dir, flex, height, hidden, id, left, listBoxObject, maxHeight, maxWidth, menu, minHeight, minWidth, observes, ordinal, orient, pack, persist, ref, resource, statusText, style, tooltip, tooltipText, top, value, width

Inherited from DOM element
attributes, childNodes, cloneNode, firstChild, lastChild, localName, namespaceURI, nextSibling, nodeName, nodeType, nodeValue, ownerDocument, parentNode, prefix, previousSibling, tagName

[edit] Methods

Inherited from XUL element
blur, click, doCommand, focus, getElementsByAttribute

Inherited from DOM element
addEventListener, appendChild, dispatchEvent, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, hasAttribute, hasAttributeNS, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, removeEventListener, replaceChild, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS

[edit] Related

Elements
menu, menuitem, menulist, menupopup, menuseparator
Interfaces
nsIAccessibleProvider