How to use the gui.MessageLoop function in gui

To help you get started, we’ve selected a few gui 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 oyyd / react-yue / src / __tests__ / app.js View on Github external
// Create a window and a root container:
const win = gui.Window.create({})
win.setContentSize({ width: 400, height: 250 })

const contentView = gui.Container.create()
contentView.setStyle({ flexDirection: 'row' })
win.setContentView(contentView)
win.center()
win.activate()

// Create your react elements and render them:
render(, contentView)

// Start your app
if (!process.versions.yode) {
  gui.MessageLoop.run()
  process.exit(0)
}
github yue / wey / lib / controller / window-manager.js View on Github external
quit() {
    for (const win of this.windows)
      win.window.close()

    require('../view/notification-center').unload()
    require('../controller/config-store').serialize()
    gui.MessageLoop.quit()
    process.gc(true, 2)

    // Ignore pending Node.js works.
    process.exit(0)
  }
}
github yue / wey / lib / main.js View on Github external
async function checkSingleInstanceAndStart() {
  if (await require('./util/single-instance').check()) {
    gui.MessageLoop.quit()
    process.exit(0)
  }
  main()
}