From 19c9170d6c0f3ad70d9687f2424755d472856802 Mon Sep 17 00:00:00 2001 From: Greggman Date: Sat, 11 Jun 2016 14:09:53 +0900 Subject: [PATCH] Document Menu.setApplicationMenu from main process You can't call Menu.setApplicationMenu until the app is ready. [ci skip] --- docs/api/menu.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/api/menu.md b/docs/api/menu.md index 2b555fd83d60..0432360cb04e 100644 --- a/docs/api/menu.md +++ b/docs/api/menu.md @@ -206,6 +206,15 @@ The `menu` class has the following methods: Sets `menu` as the application menu on OS X. On Windows and Linux, the `menu` will be set as each window's top menu. +**NOTE** if calling from the main process you can not call this function until after you've recevied the `'ready'` event from the application. + +``` +app.on('ready', () => { + Menu.setApplicationMenu(menu); + ... +}); +``` + ### `Menu.sendActionToFirstResponder(action)` _OS X_ * `action` String