add main.tsx
This commit is contained in:
1 parent
09719f7788
commit
ebbae1ae79
5 files changed
+931
-35
No files matched your search
@@ -0,0 +1,31 @@
|
||||
import { app, BrowserWindow, Menu, MenuItem, dialog } from 'electron';
|
||||
|
||||
let mainWindow: BrowserWindow = null;
|
||||
let createWindow = function () {
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
// nodeIntegration: true
|
||||
}
|
||||
// fullscreenable:false,
|
||||
// maximizable:false
|
||||
})
|
||||
mainWindow.webContents.openDevTools()
|
||||
mainWindow.loadFile('index.html')
|
||||
mainWindow.on('closed', function () {
|
||||
mainWindow = null
|
||||
})
|
||||
}
|
||||
app.on('ready', createWindow)
|
||||
app.on('window-all-closed', () => {
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', () => {
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user