博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
electron 创建窗口2
阅读量:4638 次
发布时间:2019-06-09

本文共 1306 字,大约阅读时间需要 4 分钟。

/** * 窗口管理类,单例,负责创建所有窗口,保存窗口实例 */const path = require('path');const os = require('os');const EucWindow = require('./euc_window');/** * 窗口管理类,单例,负责创建所有窗口,保存窗口实例 */class WindowManager {    constructor() {        this.main = null;        this.about = null;        this.setting = null;    }    /**     * 主窗口     * @returns {EucWindow}     */     createMainWindow(){        if(this.main) return this.main;        // 主窗口样式        const mainStyle = {            // width: 280,            // height: 400,            // resizable: false,   //         frame: os.platform() !== "win32",            show: true        };        this.main = new EucWindow(mainStyle, path.join(__dirname, '../../index.html'), this.main);        return this.main;    }    /**     * 关于窗口     * @returns {EucWindow}     */    createAboutWindow() {        if(this.about) return this.about;        // 关于窗口样式        const style = {            width: 288,            height: 336,            resizable: false,            frame: os.platform() !== "win32",            show: true,            modal: true,            parent: this.main        };        this.about = new EucWindow(style, path.join(__dirname, '../test.html'), this.about);        return this.about;    }}module.exports = WindowManager;

 

转载于:https://www.cnblogs.com/sxz2008/p/6796701.html

你可能感兴趣的文章
谈谈对web标准的理解
查看>>
DIV+CSS规范命名大全集合
查看>>
求二进制中1的个数(编程之美2.1)
查看>>
hdu 4289 网络流拆点,类似最小割(可做模板)邻接矩阵实现
查看>>
58前端内推笔试2017(含答案)
查看>>
写给自己的web开发资源
查看>>
Java学习笔记
查看>>
sprintf 和strcpy 的差别
查看>>
打表打表何谓打表?
查看>>
MPEG4与.mp4
查看>>
实验5
查看>>
git 下载 安装
查看>>
录制终端信息并回放
查看>>
JS中window.event事件使用详解
查看>>
ES6深入学习记录(一)class方法相关
查看>>
《BI项目笔记》用Excel2013连接和浏览OLAP多维数据集
查看>>
C语言对mysql数据库的操作
查看>>
SQL Server 数据库备份
查看>>
INNO SETUP 获得命令行参数
查看>>
Charles抓取https请求
查看>>