Skip to content

Instantly share code, notes, and snippets.

@thesabbir
Created November 26, 2014 06:48
Show Gist options
  • Save thesabbir/410b9a32173de36cfb61 to your computer and use it in GitHub Desktop.
Save thesabbir/410b9a32173de36cfb61 to your computer and use it in GitHub Desktop.
node webkit
<!doctype html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<title>Window Menu Example</title>
<script>
var nw = require('nw.gui');
// Window menu
var windowMenu = new nw.Menu({
type: 'menubar'
});
// Assign to window
nw.Window.get().menu = windowMenu;
// Help menu
var helpMenu = new nw.Menu();
// Add to window menu
windowMenu.append(new nw.MenuItem({
label: 'Help',
submenu: helpMenu
}));
// About sub-entry
helpMenu.append(new nw.MenuItem({
label: 'about',
click: function(){
alert('I made this!');
}
}));
</script>
</head>
<body>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Enim, ab!</p>
<p>Quos nemo dolorem iste nobis repudiandae neque perferendis necessitatibus labore!</p>
<p>Fugit, fuga alias iure dolore ab quis error nulla delectus.</p>
<p>Neque, eos dignissimos maxime illo obcaecati debitis nemo pariatur quos!</p>
<p>Aspernatur, quae sit tempore mollitia hic perspiciatis dolore. Ratione, ipsa?</p>
<p>Aliquam, quidem sint veniam iste architecto deleniti sed consequuntur vel.</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment