Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MenuItem click functions do not work in 0.94.0 #8240

Open
prominentdetail opened this issue Dec 11, 2024 · 2 comments
Open

MenuItem click functions do not work in 0.94.0 #8240

prominentdetail opened this issue Dec 11, 2024 · 2 comments
Labels
bug has-min-repro Has a minimum reproduction

Comments

@prominentdetail
Copy link

Issue Type

Bug Report.
MenuItem click functions do not work in 0.94.0

Additional Info

  • Operating System: any
  • NW.js Version: 0.94
  • Repro Link: nwjsMenu_Bug.zip
  • Code snippet:
var gui = require('nw.gui');	
gui.Window.get().showDevTools();


//menubar stuff- needs osx as well
var your_menu = new nw.Menu({ type: 'menubar' });
if(process.platform == "darwin"){
	your_menu.createMacBuiltin("Crocotile3D");	//I need to change some values in files for mac to this name instead of nwjs
	your_menu.removeAt(0);
	your_menu.removeAt(0);
}
var strArray = ['a','shift'];


var loadItem = new nw.MenuItem({ label: 'Load Scene', key: strArray[0], modifiers: strArray[1], click: function() { test(); } });		

var fileSubmenu = new nw.Menu();	
fileSubmenu.append(loadItem);


// the menu item appended should have a submenu
your_menu.append(new nw.MenuItem({ label: 'File', submenu: fileSubmenu, click: function(){  } }));

gui.Window.get().menu = your_menu;
		

function test(){
	
	console.log("selected menu item");
	
}
@pragma-git
Copy link

I have the same problem.

@iopenet
Copy link

iopenet commented Dec 19, 2024

Menu not working after update to nwjs-v0.94.0-win-x64

@ayushmanchhabra ayushmanchhabra added bug has-min-repro Has a minimum reproduction labels Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug has-min-repro Has a minimum reproduction
Projects
None yet
Development

No branches or pull requests

4 participants