-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.js
More file actions
49 lines (42 loc) · 1.48 KB
/
main.js
File metadata and controls
49 lines (42 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
const { app, BrowserWindow } = require('electron')
const path = require('path')
const url = require('url')
function createWindow () {
// Cree la fenetre du navigateur.
const win = new BrowserWindow({
width: 1280,
height: 800,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
win.loadURL(url.format({
pathname: path.join(__dirname, 'dist/galeries-ponthe/index.html'),
protocol: 'file:',
slashes: true
}))
// Ouvre les DevTools.
// win.webContents.openDevTools()
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Certaines APIs peuvent être utilisées uniquement quand cet événement est émit.
app.whenReady().then(createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', () => {
// Sur macOS, il est commun pour une application et leur barre de menu
// de rester active tant que l'utilisateur ne quitte pas explicitement avec Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', () => {
// Sur macOS, il est commun de re-créer une fenêtre de l'application quand
// l'icône du dock est cliquée et qu'il n'y a pas d'autres fenêtres d'ouvertes.
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})
// In this file you can include the rest of your app's specific main process
// code. Vous pouvez également le mettre dans des fichiers séparés et les inclure ici.