MessageLoop

Post events to main GUI message loop.

Header#include "nativeui/message_loop.h"
Namespacenamespace nu
Typeclass

Depending on the runtime you use, Yue may or may not provide this API.

Note that MessageLoop is a class instead of an instance, the APIs are provided as class methods. This is because the MessageLoop does not manage message loop, it just provides wrappers of system GUI message loop APIs.

If you are using Yue in an environment that does not have its own event loop, you should use this API to enter message loop.

nu::MessageLoop::Run();

Class methods

void Run()

Enter message loop.

void Quit()

Quit message loop.

void PostTask(const std::function<void()>& task)

Post a task to message loop.

Parameters

void PostDelayedTask(int ms, const std::function<void()>& task);

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

Parameters