mozilla

Revision 84967 of showPopup

  • Revision slug: XUL/Method/showPopup
  • Revision title: showPopup
  • Revision id: 84967
  • Created:
  • Creator: pippijn
  • Is current revision? No
  • Comment separated return type from other comment; one or more formatting changes

Revision Content

{{ XULRefMeth() }}
{{ XULMeth2("showPopup", "( element, x, y, popupType, anchor, align )") }} Deprecated in Mozilla 1.9
Return type: no return value
Deprecated in favor of openPopup and openPopupAtScreen
Opens a popup element. There are two ways of specifying where the popup appears, either at a specific screen position, or relative to some element in the window. If either x or y are set to values, the popup will appear at the screen coordinate (x,y). If x and y are -1, the popup will be positioned relative to the element specified as the first argument. This is what you might do to show a popup below a button, for example. In this latter case, the anchor and align arguments may be used to further control where the popup appears relative to the element. The anchor argument corresponds to the {{ XULAttr("popupanchor") }} attribute on the element. The align argument corresponds to the {{ XULAttr("popupalign") }} attribute on the element. The anchor and align arguments are ignored if either x or y are not -1.
To have a popup appear relative to another element yet still offset by some number of pixels, determine the actual screen position of the element using the {{ XULProp("boxObject") }}.screenX and {{ XULProp("boxObject") }}.screenY properties of the element, and use those as the x and y arguments offset by the desired values.
The popupType should be either the string popup, context, or tooltip. Each type of popup is intended to be displayed only temporarily; they are not expected to be displayed permanently. Only one popup may be displayed at a time.

{{ languages( { "fr": "fr/XUL/M\u00e9thodes/showPopup", "ja": "ja/XUL/Method/showPopup", "pl": "pl/XUL/Metoda/showPopup" } ) }}

Revision Source

<div class="noinclude">{{ XULRefMeth() }}</div>
<dl> <dt>{{ XULMeth2("showPopup", "( element, x, y, popupType, anchor, align )") }} <span style="border: 1px solid rgb(152, 152, 240); background-color: rgb(221, 221, 255); font-size: 9px; vertical-align: text-top;">Deprecated in Mozilla 1.9</span></dt> <dd>Return type: <em>no return value</em><br> <em>Deprecated in favor of openPopup and <span>openPopupAtScreen</span></em></dd> <dd>Opens a popup element. There are two ways of specifying where the popup appears, either at a specific screen position, or relative to some element in the window. If either <var>x</var> or <var>y</var> are set to values, the popup will appear at the screen coordinate (<var>x</var>,<var>y</var>). If <var>x</var> and <var>y</var> are <code>-1</code>, the popup will be positioned relative to the <var>element</var> specified as the first argument. This is what you might do to show a popup below a button, for example. In this latter case, the <var>anchor</var> and <var>align</var> arguments may be used to further control where the popup appears relative to the element. The <var>anchor</var> argument corresponds to the {{ XULAttr("popupanchor") }} attribute on the element. The <var>align</var> argument corresponds to the {{ XULAttr("popupalign") }} attribute on the element. The <var>anchor</var> and <var>align</var> arguments are ignored if either <var>x</var> or <var>y</var> are not <code>-1</code>.</dd>
</dl>
<dl> <dd>To have a popup appear relative to another element yet still offset by some number of pixels, determine the actual screen position of the element using the {{ XULProp("boxObject") }}.screenX and {{ XULProp("boxObject") }}.screenY properties of the element, and use those as the <var>x</var> and <var>y</var> arguments offset by the desired values.</dd>
</dl>
<dl> <dd>The <var>popupType</var> should be either the string <code>popup</code>, <code>context</code>, or <code>tooltip</code>. Each type of popup is intended to be displayed only temporarily; they are not expected to be displayed permanently. Only one popup may be displayed at a time.</dd>
</dl>
<div class="noinclude">
<p>{{ languages( { "fr": "fr/XUL/M\u00e9thodes/showPopup", "ja": "ja/XUL/Method/showPopup", "pl": "pl/XUL/Metoda/showPopup" } ) }}</p>
</div>
Revert to this revision