2 menubars

1 view
Skip to first unread message

grze...@gmail.com

unread,
Nov 8, 2013, 10:35:12 AM11/8/13
to node-...@googlegroups.com
Hello.

I can't find anywhere in the documentation how to make 2 window menubar's one by one. I have nice window bar filled with option, but i wish to have another one under. Im creating first menubar simply:


var MenuBar = new gui.Menu({
    type:   'menubar'
});

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


Now. If i will create another menubar object, is there any way to simply assign it to window?

var MenuBar2 = new gui.Menu({
    type:   'menubar'
});



??

Ewald Horn

unread,
Nov 8, 2013, 11:04:43 AM11/8/13
to node-...@googlegroups.com
Hi,

do you want two MENU's or two MENU BARS?

I don't think you can have two menu bars, but you can certainly have multiple items on your menu bar. The following code creates a menu bar and two entries, one with a submenu as well.  Does this help?

    var menubar = new window.gui.Menu({type:'menubar'});
   
    var aboutmnu = new window.gui.Menu();
    aboutmnu.append(new window.gui.MenuItem({type: 'normal', label: 'About', click: function(){}}));
   
    aboutTopLevel = new window.gui.MenuItem({label: "Help"});
    aboutTopLevel.submenu = aboutmnu;
   
    menubar.append(aboutTopLevel);
    menubar.append(new window.gui.MenuItem({type: 'normal', label: 'Exit', click: function(){}}));
    window.gui.Window.get().menu = menubar;


Best regards,
Ewald


--
You received this message because you are subscribed to the Google Groups "node-webkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-webkit...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

grze...@gmail.com

unread,
Nov 8, 2013, 5:19:42 PM11/8/13
to node-...@googlegroups.com
Thanks, for answer.

No, I was talking about 2 menubars...If you launch most of .NET app in windows you will find that it has more that mone thin bar. It's like 2 level menubar.

I would expect o add another menubar like that:


window.gui.Window.get().menu = menubar
window.gui.Window.add().menu = menubar2;

Or something like that. But it's impossible i will have to use HTML space to make some additional menu. Thanks.

Ewald Horn

unread,
Nov 8, 2013, 5:36:17 PM11/8/13
to node-...@googlegroups.com

Ah,

You want to create toolbars, I see. Wow, I have no idea - I will look into it, I can't think of a solution of the top of my head. Chrome does support that, so it should be possible, there might just not be a Node WebKit binding for this yet.

Sorry I could not help.

Best regards,
Ewald

grze...@gmail.com

unread,
Nov 9, 2013, 4:20:58 AM11/9/13
to node-...@googlegroups.com

Right. Looks like it is good example to report improvement. Anyway, i solved my problem crating bar at the top od the DOM document with position: fixed  attrib.

Cheers,

Ewald Horn

unread,
Nov 9, 2013, 4:54:53 AM11/9/13
to node-...@googlegroups.com
Ah,

you obviously know more about HTML than I do - I have so much to learn still! Thank you for the great tip, I'm going to look into it as well.

Kind regards,
Ewald
Reply all
Reply to author
Forward
0 new messages