Home > Element Reference : Window

Contents

### Window

Describes the structure of a top-level window. It is the root node of a XUL document. It is by default a horizontally oriented box. As it is a box, all box attributes can be used. By default, the window will have a platform-specific frame around it.

To set an icon for the window, create a platform-specific icon file <windowid>.ico and/or <windowid>.xpm and place or install these files into the <mozilla-directory>/chrome/icons/default/ directory. The <windowid> is the value of the id attribute on the window. This allows you to have a different icon for each window.

For properties and methods, see the XUL Window object.

More information about window

Attributes:

height | hidechrome | id | screenX | screenY
sizemode | title | width | windowtype

#### 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
ref
removeelement
sortDirection
sortResource
sortResource2
statustext
style
template
tooltip
tooltiptext
top
uri
wait-cursor
width

##### height

Type: integer

Set this property to use a specific height for the window. This property, along with the width property, would usually be persisted with the persist attribute so that the next time the user opens the window, the height and width of the window will be the same as last time.

##### hidechrome

Type: boolean

Set this attribute to true to have the chrome including the titlebar hidden.

##### id

Type: element id, must be unique in the window

The window id. This is used to identify the window and to construct the filename for the icon for the window.

##### screenX

Type: integer

The horizontal position that the window appears on the screen.

##### screenY

Type: integer

The vertical position that the window appears on the screen.

##### sizemode

Type: one of the values below

The state of the window. The following values may be used:

- maximized: The window is maximized, and occupies the full size of the screen.
- minimized: The window is minimized, or hidden.
- normal: The window appears in a normal state at the desired size.

##### title

Type: string

The text to appear on the title bar of the window.

##### width

Type: integer

Set this property to use a specific width for the window.

##### windowtype

Type: string

Set to a string which can be used to identify the type of window. This might be used, for example, to distingush between a browser window and an editor window. Some of Mozilla's window handling functions use this attribute to group windows of the same type together.

#### Properties and Methods:

Inherited from XUL Element:

align | allowEvents | blur | boxObject | boxObject.element
boxObject.getLookAndFeelMetric | boxObject.height | boxObject.screenX | boxObject.screenY | boxObject.width
boxObject.x | boxObject.y | builder | className | click
collapsed | contextMenu | controllers | database | datasources
dir | doCommand | flex | focus | getElementsByAttribute
height | hidden | id | left | maxHeight
maxWidth | menu | minHeight | minWidth | observes
ordinal | orient | pack | persist | ref
resource | statusText | style | tooltip | tooltipText
top | width

Inherited from Element:

addEventListener | appendChild | attributes | childNodes | cloneNode
dispatchEvent | firstChild | getAttribute | getAttributeNS | getAttributeNode
getAttributeNodeNS | getElementsByTagName | getElementsByTagNameNS | hasAttribute | hasAttributeNS
hasAttributes | hasChildNodes | insertBefore | isSupported | lastChild
localName | namespaceURI | nextSibling | nodeName | nodeType
nodeValue | normalize | ownerDocument | parentNode | prefix
previousSibling | removeAttribute | removeAttributeNS | removeAttributeNode | removeChild
removeEventListener | replaceChild | setAttribute | setAttributeNS | setAttributeNode
setAttributeNodeNS | tagName

Copyright (C) 1999 - 2004 XulPlanet.com