本文整理汇总了TypeScript中nw.gui.default.Menu.popup方法的典型用法代码示例。如果您正苦于以下问题:TypeScript gui.default.Menu.popup方法的具体用法?TypeScript gui.default.Menu.popup怎么用?TypeScript gui.default.Menu.popup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nw.gui.default.Menu
的用法示例。
在下文中一共展示了gui.default.Menu.popup方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: showGenericContextMenu
showGenericContextMenu(ev) {
var menu1 = new gui.Menu();
menu1.append(new gui.MenuItem({ label: 'New Document', click: () => {
this.newFile();
}}));
menu1.append(new gui.MenuItem({ label: 'New Folder', click: () => {
this.addFolder();
}}));
menu1.append(new gui.MenuItem({ type: "separator" }));
menu1.append(new gui.MenuItem({ label: 'Reveal in ' + this.getExplorerName(), click: () => {
gui.Shell.openExternal(this.folder.path);
}}));
menu1.popup(ev.x, ev.y);
}
示例2: showFolderContextMenu
showFolderContextMenu(folder:Models.IFolder, ev) {
var menu1 = new gui.Menu();
menu1.append(new gui.MenuItem({ label: 'Reveal in ' + this.getExplorerName(), click: () => {
gui.Shell.openExternal(folder.path);
}}));
menu1.append(new gui.MenuItem({ type: "separator" }));
menu1.append(new gui.MenuItem({ label: 'Rename', click: () => {
this.renameFolder(folder);
}}));
menu1.append(new gui.MenuItem({ label: 'Delete', click: () => {
}}));
menu1.popup(ev.x, ev.y);
ev.stopImmediatePropagation();
}
示例3: showFileContextMenu
showFileContextMenu(document:Models.IDocument, ev) {
var menu1 = new gui.Menu();
menu1.append(new gui.MenuItem({ label: 'Reveal in ' + this.getExplorerName(), click: () => {
gui.Shell.showItemInFolder(document.path);
}}));
menu1.append(new gui.MenuItem({ label: 'Copy path to clipboard', click: () => {
var clipboard = gui.Clipboard.get();
clipboard.set(document.path, 'text');
}}));
menu1.append(new gui.MenuItem({ type: "separator" }));
menu1.append(new gui.MenuItem({ label: 'Rename', click: () => {
this.renameFile(document);
}}));
menu1.append(new gui.MenuItem({ label: 'Delete', click: () => {
}}));
menu1.popup(ev.x, ev.y);
ev.stopImmediatePropagation();
}
示例4: require
/// <reference path="../typings/tsd.d.ts" />
var gui = require('nw.gui'),
win = gui.Window.get(),
menu = new gui.Menu();
menu.append(
new gui.MenuItem({
label: "menuItem01",
click: () => {
console.log("click menuItem!!");
}
}));
menu.popup(20,20);