nw-sample-apps icon indicating copy to clipboard operation
nw-sample-apps copied to clipboard

Custom Tray Menu doesnt work on MacOSX

Open TheAifam5 opened this issue 9 years ago • 2 comments

NW.JS Version: v0.15.4 NW.JS Commit hash: 63bc85a-0fc8753-3ee2c58-8655cb9

/Users/theaifam5/Desktop/Test/custom-tray-menu/custom_tray_menu.js:3
var gui = global.window.nwDispatcher.requireNwGui();
                                    ^
TypeError: Cannot read property 'requireNwGui' of undefined
    at Object.<anonymous> (/Users/theaifam5/Desktop/Test/custom-tray-menu/custom_tray_menu.js:3:37)
    at Module._compile (module.js:565:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:482:32)
    at tryModuleLoad (module.js:441:12)
    at Function.Module._load (module.js:433:3)
    at Module.require (module.js:492:17)
    at require (internal/module.js:20:19)
    at self.require (<anonymous>:11:26)

Buttons also doesn't work.

TheAifam5 avatar Jul 20 '16 08:07 TheAifam5

I just tried this and got the same error.

i was following the tutorial here: https://github.com/nwjs/npm-installer

x-MacBook-Pro:nw-sample-apps apple$ "node_modules/.bin/nw" custom-tray-menu

/Users/apple/workspace/go/src/bitbucket.org/gedw99/md/try/nwjs/nw-sample-apps/custom-tray-menu/custom_tray_menu.js:3
var gui = global.window.nwDispatcher.requireNwGui();
                                    ^
TypeError: Cannot read property 'requireNwGui' of undefined
    at Object.<anonymous> (/Users/apple/workspace/go/src/bitbucket.org/gedw99/md/try/nwjs/nw-sample-apps/custom-tray-menu/custom_tray_menu.js:3:37)
    at Module._compile (module.js:565:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:482:32)
    at tryModuleLoad (module.js:441:12)
    at Function.Module._load (module.js:433:3)
    at Module.require (module.js:492:17)
    at require (internal/module.js:20:19)
    at self.require (<anonymous>:11:26)

joeblew99 avatar Aug 21 '16 10:08 joeblew99

I've created a new Tray Menu app example, which should solve this problem. I was having similar problems on Windows and Ubuntu, and those problems are fixed with my version. Please see PR #41.

joshplant avatar Jan 10 '17 11:01 joshplant