Home > Element Reference : Menubar

Contents

### Menubar

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 about Menubar

#### Attributes:

Attributes inherited from XUL Element

accesskey

This should be set to a letter that is used as a shortcut key. This letter should be one of the characters that appears in the label text for the menubar. This letter will typically be drawn underlined, although this behavior will be platform and skin specific. When the user presses ALT (or a similar key that varies on each platform) and the access key, the menubar will be activated from anywhere in the window.

command

Set to an id of a command element that is being observed by the element.

crop

If the label of the menubar is too small to fit in its given space, the text will be cropped on the side specified by the crop attribute. An ellipsis will be placed in place of the cropped text. If the box direction is right to left (rtl), the cropping is reversed.

- start: The text will be cropped on its left side.
- end: The text will be cropped on its right side.
- left: (Deprecated) The text will be cropped on its left side.
- right: (Deprecated) The text will be cropped on its right side.
- center: The text will be cropped on both sides.
- none: The text will be not be cropped using an ellipsis. However, the text will simply be cut off if it is too large. The side depends on the CSS text alignment.

disabled

If this attribute is set to true, the menubar is disabled. This is usually drawn with the text in grey. If the menubar is disabled, the function of the button cannot be performed. Leave the attribute out entirely for a regular enabled button.

grippyhidden

When set to true, the grippy will be hidden. When set to false, the default, the grippy will be shown.

image

The URL of the image to appear on the menubar. If this is attribute is left out, no image appears. The position of the image is determined by the dir and orient attributes.

label

The label that will appear on the menubar. If this is left out, no text appears.

value

A value associated with the menubar. You may use it in a script for your own purposes.

#### Properties and Methods:

Properties and Methods inherited from XUL Element

accesskey

This should be set to a letter that is used as a shortcut key. This letter should be one of the characters that appears in the label text for the menubar. This letter will typically be drawn underlined, although this behavior will be platform and skin specific. When the user presses ALT (or a similar key that varies on each platform) and the access key, the menubar will be activated from anywhere in the window.

command

Set to an id of a command element that is being observed by the element.

crop

If the label of the menubar is too small to fit in its given space, the text will be cropped on the side specified by the crop attribute. An ellipsis will be placed in place of the cropped text. If the box direction is right to left (rtl), the cropping is reversed.

- start: The text will be cropped on its left side.
- end: The text will be cropped on its right side.
- left: (Deprecated) The text will be cropped on its left side.
- right: (Deprecated) The text will be cropped on its right side.
- center: The text will be cropped on both sides.
- none: The text will be not be cropped using an ellipsis. However, the text will simply be cut off if it is too large. The side depends on the CSS text alignment.

disabled

If this attribute is set to true, the menubar is disabled. This is usually drawn with the text in grey. If the menubar is disabled, the function of the button cannot be performed. Leave the attribute out entirely for a regular enabled button.

doCommand ( )

Executes the associated command.

image

The URL of the image to appear on the menubar. If this is attribute is left out, no image appears. The position of the image is determined by the dir and orient attributes.

label

The label that will appear on the menubar. If this is left out, no text appears.

value

A value associated with the menubar. You may use it in a script for your own purposes.

Copyright (C) 1999 - 2002 XULPlanet.com