I am using you repo--> nw.js with aurelia .. I am able to require("nw.gui") as you did in window bar.js
. But I am not able to create new gui.Menu() .
Some code for reference
var gui = require('nw.gui');
export class App {
add_collection () {
console.log("add collection called");
}
attached() {
console.log("attached called",gui);
var menu = new gui.Menu();
menu.append(new gui.MenuItem({
label: 'Add Collection',
click: this.add_collection
}));
$("body").bind('contextmenu', function(ev) {
ev.preventDefault();
menu.popup(ev.pageX, ev.pageY);
return false;
});
}
}
Any one can help me on this????? Thanx in advance
@singh-manpreet1 Can you provide specific details about the error you are receiving? What file are you trying to do this in? What exactly does the error say?
I am using you repo--> nw.js with aurelia .. I am able to require("nw.gui") as you did in window bar.js . But I am not able to create new gui.Menu() . Some code for reference var gui = require('nw.gui'); export class App { add_collection () { console.log("add collection called"); } attached() { console.log("attached called",gui); var menu = new gui.Menu(); menu.append(new gui.MenuItem({ label: 'Add Collection', click: this.add_collection })); $("body").bind('contextmenu', function(ev) { ev.preventDefault(); menu.popup(ev.pageX, ev.pageY); return false; }); } } Any one can help me on this????? Thanx in advance