當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript dialog.showMessageBox方法代碼示例

本文整理匯總了TypeScript中electron.dialog.showMessageBox方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript dialog.showMessageBox方法的具體用法?TypeScript dialog.showMessageBox怎麽用?TypeScript dialog.showMessageBox使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在electron.dialog的用法示例。


在下文中一共展示了dialog.showMessageBox方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: zipdir

    zipdir(`${WEB_PATH[process.platform]}`, {saveTo: fileName}, err => {
      if (err) {
        dialog.showMessageBox({message: 'This chart has NOT been exported.', buttons: ['OK']});
        ga.error('Export for Web was NOT completed: ' + err.toString());
        return;
      }

      dialog.showMessageBox({message: 'This chart has been exported.', buttons: ['OK']});
    });
開發者ID:VS-work,項目名稱:gapminder-offline,代碼行數:9,代碼來源:file-management.ts

示例2:

    socket.on('showMessageBox', (browserWindow, options, guid) => {
        if ("id" in browserWindow) {
            var window = BrowserWindow.fromId(browserWindow.id);

            dialog.showMessageBox(window, options, (response, checkboxChecked) => {
                socket.emit('showMessageBoxComplete' + guid, [response, checkboxChecked]);
            });
        } else {
            var message = browserWindow;
            let id = guid || options;
            dialog.showMessageBox(browserWindow, (response, checkboxChecked) => {
                socket.emit('showMessageBoxComplete' + id, [response, checkboxChecked]);
            });
        }
    });
開發者ID:E024,項目名稱:Electron.NET,代碼行數:15,代碼來源:dialog.ts

示例3: function

app.on('ready', function () {

    Menu.setApplicationMenu(null);

    let iconFile = process.platform === 'win32' ? 'tray.ico' : 'trayTemplate.png';
    tray = new Tray(path.normalize(`${app.getAppPath()}/icons/${iconFile}`));

    var windowOptions = Object.assign({}, {
      width: currentTheme.settings.BTWindowWidth,
      height: currentTheme.settings.BTWindowHeight,
      webPreferences: { preload:  path.resolve(`${__dirname}/preload.js`) }
    }, env.windowProperties)

    mainWindow = createWindow('main', windowOptions);

    mainWindow.loadURL(`file://${currentTheme.path}/${currentTheme.settings.BTMainFile}`);

    tray.setContextMenu(trayMenu);
    console.log('wtf');

    console.log(dialog.showMessageBox(mainWindow, {type: 'info', message: `Welcome Back, You arrived!`}));

    if (1 == 1 || env.name === 'development') {
        mainWindow.openDevTools();
    }
});
開發者ID:ryan-nauman,項目名稱:spotify-mini,代碼行數:26,代碼來源:background.ts

示例4:

const shouldQuit = app.makeSingleInstance((commandLine, workingDirectory) => {
  dialog.showMessageBox({type: 'info', message: `Welcome Back, You arrived from: ${commandLine}`});
  // Someone tried to run a second instance, we should focus our window.
  if (mainWindow) {
    mainWindow.focus();
  }
});
開發者ID:ryan-nauman,項目名稱:spotify-mini,代碼行數:7,代碼來源:background.ts

示例5: loadFullMenu

 .then(kernelSpecs => {
   if (Object.keys(kernelSpecs).length !== 0) {
     store.dispatch(setKernelSpecs(kernelSpecs));
     const menu = loadFullMenu();
     Menu.setApplicationMenu(menu);
     const logo =
       process.platform === "win32" ? "logoWhite" : "logoTemplate";
     const trayImage = join(__dirname, "..", "static", `${logo}.png`);
     tray = new Tray(trayImage);
     const trayMenu = loadTrayMenu();
     tray.setContextMenu(trayMenu);
   } else {
     dialog.showMessageBox(
       {
         type: "warning",
         title: "No Kernels Installed",
         buttons: [],
         message: "No kernels are installed on your system.",
         detail:
           "No kernels are installed on your system so you will not be " +
           "able to execute code cells in any language. You can read about " +
           "installing kernels at " +
           "https://ipython.readthedocs.io/en/latest/install/kernel_install.html"
       },
       index => {
         if (index === 0) {
           app.quit();
         }
       }
     );
   }
 })
開發者ID:nteract,項目名稱:nteract,代碼行數:32,代碼來源:index.ts

示例6: getLicense

 click: (menuItem, browserWindow) => {
   dialog.showMessageBox(browserWindow, {
     title: 'LICENSE',
     message: getLicense(),
     type: 'info',
   });
 },
開發者ID:Heeryong-Kang,項目名稱:jamak,代碼行數:7,代碼來源:menu.ts

示例7: getVersion

 click: (menuItem, browserWindow) => {
   dialog.showMessageBox(browserWindow, {
     title: 'Info',
     message: getVersion(),
     type: 'info',
   });
 },
開發者ID:Heeryong-Kang,項目名稱:jamak,代碼行數:7,代碼來源:menu.ts

示例8: EnforcePreviewBuildExpiry

// 1540857600 = Oct 30 2018
function EnforcePreviewBuildExpiry() {
  if (!previewBuildStatus.isPreview) {
    return
  }
  // If preview build, check timestamp.
  let d: any = new Date()
  let now: number = Math.floor(d / 1000)
  if (now > previewBuildStatus.Expiry) {
    elc.dialog.showMessageBox(
      {
        type: 'error',
        title: 'Developer build expired',
        message:
          'Hey there! This preview build of Aether has expired. You can get the most recent version of Aether from the meta forum at meta.getaether.net.',
        buttons: ['Quit', 'Get new version'],
      },
      function(respButtonIndex: any) {
        if (respButtonIndex === 1) {
          // The user asked to go to the downloads page.
          elc.shell.openExternal('https://meta.getaether.net')
        }
      }
    )
    // Quit app regardless of what the user chooses.
    elc.app.quit()
  }
}
開發者ID:nehbit,項目名稱:aether-public,代碼行數:28,代碼來源:mainmain.ts

示例9:

 () =>
   dialog.showMessageBox({
     title: "Command installed.",
     message: 'The shell command "nteract" is installed.',
     detail: 'Get help with "nteract --help".',
     buttons: ["OK"]
   })
開發者ID:nteract,項目名稱:nteract,代碼行數:7,代碼來源:cli.ts

示例10:

ipcMain.on('show-dialog', (event, arg) => {
  dialog.showMessageBox(win, {
    type: 'info',
    buttons: ['OK'],
    title: 'Native Dialog',
    message: 'I\'m a native dialog!',
    detail: 'It\'s my pleasure to make your life better.'
  });
});
開發者ID:greg9504,項目名稱:angular-electron-dream-starter,代碼行數:9,代碼來源:index.ts


注:本文中的electron.dialog.showMessageBox方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。