Lifetime

Event loop and application lifetime.

Modulerequire("gui")
TypeClass

This class initializes a GUI event loop, and provides APIs to manage application's lifetime. Depending on the runtime you use, Yue may or may not provide this API.

This class can not be created by user, you can only receive its global instance from the lifetime property of the module:

const gui = require('gui')
gui.lifetime.run()

Methods

run()

Enter event loop.

quit()

Quit event loop.

postTask(task)

Post a task to event loop.

Parameters

postDelayedTask(ms, task)

Post a task to event loop and execute it after ms.

Parameters

Events

onReady() macOS

Emitted when received applicationDidFinishLaunching notification.

Preventable

No.