当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript nw.gui.default.Window类代码示例

本文整理汇总了TypeScript中nw.gui.default.Window的典型用法代码示例。如果您正苦于以下问题:TypeScript gui.default.Window类的具体用法?TypeScript gui.default.Window怎么用?TypeScript gui.default.Window使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了gui.default.Window类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: function

    process.on('uncaughtException', function (err) {
        console.error("Uncaught exception occured: " + err);
        console.error(err.stack);
        alert(err);
    });
   
    // Instantiate the global ide   
    IDE = new Ide();     
    
    var prjName = determineProject();
    if (prjName) {
        IDE.addProject(new Project(prjName));
    } else {
        IDE.restorePreviousProjects();
    }
    
    IDE.init();
    
    // Catch the close of the windows in order to save any unsaved changes
    var win = GUI.Window.get();
    win.on("close", function() {
        if (IDE.hasUnsavedSessions()) {
            if (! confirm("There are unsaved files!\nDo you really want to quit?")) return;
        }
        
        IDE.saveConfig();
        this.close(true);
    });

}
开发者ID:LordZardeck,项目名称:cats,代码行数:30,代码来源:main.ts

示例2: 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);

开发者ID:n-kats,项目名称:nditor,代码行数:14,代码来源:gui.ts

示例3: require

var gui = require("nw.gui");
var mainWindow = gui.Window.get();

var menu = new gui.Menu({type: 'menubar'});
var menu_file = new gui.Menu();
var menu_help = new gui.Menu();

menu.append(new gui.MenuItem({ label: "File", submenu: menu_file}));
menu.append(new gui.MenuItem({ label: "Help", submenu: menu_help}));

menu_file.append(new gui.MenuItem({ label: "Exit", click: () => {
	mainWindow.close();
}}));

menu_help.append(new gui.MenuItem({ label: "Reload Dev", click: () => {
	mainWindow.reloadDev();
}}));
menu_help.append(new gui.MenuItem({ label: "Show Dev Tools", click: () => {
	mainWindow.showDevTools();
}}));
menu_help.append(new gui.MenuItem({ type: "separator" }));
menu_help.append(new gui.MenuItem({ label: "About"}));

mainWindow.menu = menu;

/**
 * Disable DragDrop in the window
 */
window.ondragover = function(e) { e.preventDefault(); return false };
window.ondrop = function(e) { e.preventDefault(); return false };
开发者ID:bihai,项目名称:Notedown,代码行数:30,代码来源:app.ts

示例4: setTitle

		setTitle(title:String) {
			var win = gui.Window.get();
			win.title = "Notedown - " + title;
		}
开发者ID:bihai,项目名称:Notedown,代码行数:4,代码来源:WindowService.ts

示例5: require

namespace jmxhealth {
    var pubsub = require('pubsub-js'),
        initializedServices = 0,
        gui = require('nw.gui'),
        currentWindow = gui.Window.get();

    //When all services are initialized we sent the start event
    pubsub.subscribe(topic.INITIALIZED, (message: string, data: string) => {
        initializedServices += 1;

        if (initializedServices === 2) {
            pubsub.publish(topic.START, 'Let`s get this party started :)');
        }
    });

    currentWindow.on('close', (event: any) => {
        currentWindow.hide();
    });


    angular.module('jmxhealth', ['jmxhealth.common', 'jmxhealth.state', 'jmxhealth.tray', 'jmxhealth.state', 'jmxhealth.detail'])
        .controller('TestController', function() {
            this.publish = function(state: string): void {
                pubsub.publish(topic.OVERALL_STATE, state);
            };
        });
}
开发者ID:thred,项目名称:jmxhealth,代码行数:27,代码来源:Main.ts

示例6: showDevTools

 /**
  * Open the webkit developers tools for debugging etc.
  */ 
 function showDevTools() {
     var GUI = require('nw.gui');
     GUI.Window.get().showDevTools();
 }
开发者ID:BundyRukus,项目名称:cats,代码行数:7,代码来源:helpCommands.ts


注:本文中的nw.gui.default.Window类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。