const {app, BrowserWindow, dialog} = require('electron');

let mainWindow;

app.on('ready', () => {
  mainWindow = new BrowserWindow({
      useContentSize: true,
      fullscreenable: true,
      resizable : true,
      icon: __dirname + '/app.ico',
  });

  //mainWindow.setMenu(null);
  mainWindow.loadURL('file://' + __dirname + '/htdocs/index.html');
});

const ipc = require('electron').ipcMain

ipc.on('open-information', function (event, arg) {
    const options = {
        type: 'info',
        title: 'Information',
        message: arg,
        buttons: ['OK']
    }
    dialog.showMessageBox(options, function (index) {
        event.sender.send('information-dialog', index)
    })
});
