Thursday 1 June 2017

How do I customize the nwjs tray right-click menu?

//add menu  
var menu = new gui.Menu();

menu.append(new gui.MenuItem({
    type: 'normal',
    label: 'show/hide',
    click: function() {
        if (isShowWindow) {
            win.hide();
            isShowWindow = false;
        } else {
            win.show();
            isShowWindow = true;
        }
    }
}));
tray.menu = menu;

This is part of the code I added to the menu, using the method provided by nwjs

My app screen

I expect the effect

Who can help me solve this problem? I would like to use css + html to create a custom tray menu.



via John Doe.

No comments:

Post a Comment