forked from dom111/civ-clone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
boot.js
42 lines (34 loc) · 806 Bytes
/
boot.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
const {
FlexLayout,
QLabel,
QMainWindow,
QWidget
} = NodeGui;
import NodeGui from '@nodegui/nodegui';
import {Worker} from 'worker_threads';
const win = new QMainWindow();
const centralWidget = new QWidget();
centralWidget.setObjectName("myroot");
const rootLayout = new FlexLayout();
centralWidget.setLayout(rootLayout);
const label = new QLabel();
label.setInlineStyle("font-size: 16px; font-weight: bold;");
label.setText("Loading...");
rootLayout.addWidget(label);
win.setCentralWidget(centralWidget);
win.setStyleSheet(
`
#myroot {
background-color: #e7e7e7;
}
`
);
win.show();
global.window = win;
const engine = new Worker('./engine.js', {
workerData: null,
});
engine.on('message', ({event, args}) => {
label.setText(event);
// console.log(event, args);
});