Merge pull request #11754 from electron/menu-events

Add and document menu events
This commit is contained in:
shelley vohr 2018-01-29 12:40:57 -05:00 committed by GitHub
commit 12d4f984f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 69 additions and 6 deletions

View file

@ -99,6 +99,29 @@ Returns `MenuItem` the item with the specified `id`
Inserts the `menuItem` to the `pos` position of the menu.
### Instance Events
Objects created with `new Menu` emit the following events:
**Note:** Some events are only available on specific operating systems and are
labeled as such.
#### Event: 'menu-will-show'
Returns:
* `event` Event
Emitted when `menu.popup()` is called.
#### Event: 'menu-will-close'
Returns:
* `event` Event
Emitted when a popup is closed either manually or with `menu.closePopup()`.
### Instance Properties
`menu` objects also have the following properties: