zoukankan      html  css  js  c++  java
  • electron开发

    针对mac平台的app

    let willQuitApp = false;  // 控制退出方式
    
    mainWindow.on('close', (e) => {
        if (willQuitApp) {
          mainWindow = null;
          printWindow = null; // 其他窗口也要会回收
        } else { // mac平台,左上角关闭窗口 = 隐藏窗口
          e.preventDefault();
          mainWindow.hide();
        }
      });
    
    // Quit when all windows are closed.
    app.on('window-all-closed', () => {
      // 在 macOS 上,除非用户用 Cmd + Q 确定地退出,
      // 否则绝大部分应用及其菜单栏会保持激活。
      if (process.platform !== 'darwin') {
        app.quit()
      }
    });
    
    app.on('before-quit', () => {
      willQuitApp = true
    });
    
    
  • 相关阅读:
    canvas之碎碎念
    canvas之动态时钟
    属性小问题
    readonly and disabled
    table
    地图热区
    子块元素在父块元素中居中
    Ajax与JS
    前端测试
    html5/css3
  • 原文地址:https://www.cnblogs.com/mapleChain/p/12516463.html
Copyright © 2011-2022 走看看