2023-02-26 01:30

This commit is contained in:
2023-02-26 01:30:37 +09:00
commit 9a13ccbd17
122 changed files with 32148 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
const { app, BrowserWindow, Menu } = require('electron');
function createWindow() {
let win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
});
createMenu();
win.loadFile('index.html');
win.webContents.openDevTools();
}
function createMenu() {
const menu = [
{
label: 'File',
submenu: [
{ label: 'Exit', role: 'quit' }
]
},
{
label: 'Edit',
submenu: [
{ label: 'Copy', role: 'copy' },
{ label: 'Cut', role: 'cut' },
{ label: 'Paste', role: 'paste' },
{ type: 'separator' },
{ label: 'Undo', role: 'undo' },
{ label: 'Redo', role: 'redo' },
]
}
];
Menu.setApplicationMenu(Menu.buildFromTemplate(menu));
}
app.whenReady().then(createWindow);
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit();
}
});
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow();
}
});