specify positioning item for popup menus

This commit is contained in:
evgenyzinoviev 2016-01-22 03:18:04 +01:00
parent 7842a657d0
commit 072ab0ddea
7 changed files with 20 additions and 10 deletions

View file

@ -237,15 +237,18 @@ Generally, the `template` is just an array of `options` for constructing a
You can also attach other fields to the element of the `template` and they
will become properties of the constructed menu items.
### `Menu.popup([browserWindow, x, y])`
### `Menu.popup([browserWindow, x, y, positioningItem])`
* `browserWindow` BrowserWindow (optional)
* `x` Number (optional)
* `y` Number (**required** if `x` is used)
* `positioningItem` Number (optional) _OS X_
Pops up this menu as a context menu in the `browserWindow`. You
can optionally provide a `x,y` coordinate to place the menu at, otherwise it
will be placed at the current mouse cursor position.
will be placed at the current mouse cursor position. `positioningItem` is the
index of the menu item to be positioned under the mouse cursor at the specified
coordinates (only supported on OS X).
### `Menu.append(menuItem)`