-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
52 lines (41 loc) · 1019 Bytes
/
index.js
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
50
51
52
/**
* (c) 2023/2024 Marcin Ślusarczyk, Maciej Bandura
* Projekt Zespołowy - DiGram
*
* Skrypt startowy aplikacji
*/
const { app, BrowserWindow, screen, Menu } = require('electron')
const { mainMenu, applyMainMenu } = require('./menu/menu.js')
const { dialog } = require('electron');
require('./menu/menu.js');
app.whenReady().then(() =>
{
const {width, height} = screen.getPrimaryDisplay().workAreaSize;
const win = new BrowserWindow
({
width: 1280,
height: 720,
frame: true
});
applyMainMenu(win);
win.loadFile('./window/window.html');
win.show();
win.maximize();
win.setIcon("./icons/main.png");
win.webContents.openDevTools()
win.on('close', function (e)
{
const response = dialog.showMessageBoxSync
(
this,
{
type: 'question',
buttons: ['Tak', 'Nie'],
title: 'Zamykanie aplikacji',
message: 'Czy aby na pewno chcesz wyjść?'
}
);
if(response == 1)
e.preventDefault();
});
})