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

OS X: Inserting menu items before 'Edit' in title bar #743

Closed
jonbeebe opened this issue May 27, 2013 · 11 comments
Closed

OS X: Inserting menu items before 'Edit' in title bar #743

jonbeebe opened this issue May 27, 2013 · 11 comments

Comments

@jonbeebe
Copy link

On OS X, one of the most widely used conventions is the 'File' menu before the Edit menu. Currently in node-webkit, we can insert items after 'Edit', but for many apps that have the need for a 'File' menu, it would look very unnatural for the menu bar to appear like so:

AppName | Edit | File | Window

I think in OS X there should be a way to insert a menu item before Edit.

@silasb
Copy link

silasb commented Jun 7, 2013

👍

I tried to handle this via menubar.insert(new gui.MenuItem({ label: 'File', submenu: file_menu}), 0); but it didn't work. Might have to dive into the code this weekend and try fixing it.

@tommoor
Copy link

tommoor commented Jun 13, 2013

It is also a common pattern to have "Help" after "Window"

AppName | File | Edit | Window | Help

However there doesn't seem to currently be a way to append after the window menu item.

@neist
Copy link

neist commented Aug 4, 2013

👍 I agree, this is a big one!
'AppName | File | Edit | Window | Help' is what you expect on a mac.

Hope they can find the time to implement a solution for this :-)

@berbaquero
Copy link

The title bar is the one on the top of the whole OS X, that starts with the  icon, right?

If that's the case, could you please point me to how to insert a menu item in the title bar?

On other words: is it actually possible to have something like this on the top/title bar?

My App | Edit | Window | My App Options

Edit: Nevermind, I found a solution and made it work - I'm gonna update the Wiki to make adding Menus to the title bar on OS X more clear.

It would be great indeed if it was possible to set where to insert the Menus.

@jonbeebe
Copy link
Author

Any updates on this?

@ghost ghost assigned kingFighter Aug 15, 2013
@kingFighter
Copy link
Contributor

with code below

  var gui = require('nw.gui');
  var win = gui.Window.get();
  var menubar = new gui.Menu({ type: 'menubar' });
  var file = new gui.Menu();
  var help = new gui.Menu();
  win.menu = menubar;
  win.menu.insert(new gui.MenuItem({ label: 'File', submenu: file}), 1);
  win.menu.append(new gui.MenuItem({ label: 'Help', submenu: help}));

You can achieve like:
screen shot 2013-08-21 at 11 03 47 am

@rhiokim
Copy link

rhiokim commented Aug 21, 2013

@kingFighter It's very nice. thanks

@SamLiu79
Copy link

How can i replace menu items under node-webkit?

@FrankFang
Copy link

@kingFighter It helps a lot! Thanks.

@djalmaaraujo
Copy link

Thanks!

@Latrasis Latrasis mentioned this issue Sep 7, 2014
@zhailei31665431
Copy link

2014-09-19 2 37 07

How to modify "your-app-name" ! Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests