Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
win.show();
});
// ----------------------
// Add everything to menu
// ----------------------
menu.addAction(hideAction);
menu.addAction(showAction);
menu.addAction(actionWithSubmenu);
menu.addAction(quitAction);
win.setWindowTitle("NodeGUI Demo");
win.resize(400, 700);
win.show();
const qApp = QApplication.instance();
qApp.setQuitOnLastWindowClosed(false); // required so that app doesnt close if we close all windows.
(global as any).win = win; // To prevent win from being garbage collected.
(global as any).systemTray = tray; // To prevent system tray from being garbage collected.
onClose(): void {
QApplication.instance().quit();
}
}
quitAction.addEventListener("triggered", () => {
const app = QApplication.instance();
app.exit(0);
});
[QPushButtonEvents.clicked]: () => {
QApplication.instance().quit();
}
},