How to use the @nodegui/nodegui.QApplication.instance function in @nodegui/nodegui

To help you get started, weโ€™ve selected a few @nodegui/nodegui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nodegui / examples / nodegui / systray / src / index.ts View on Github external
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.
github nodegui / examples / nodegui / systray / src / index.ts View on Github external
quitAction.addEventListener("triggered", () => {
  const app = QApplication.instance();
  app.exit(0);
});
github nodegui / react-nodegui / examples / weather-app-widget / src / index.tsx View on Github external
[QPushButtonEvents.clicked]: () => {
        QApplication.instance().quit();
      }
    },