State

Global state.

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

This class manages the global state of Yue's GUI components, it should always be initialized before you call any GUI related API, and released after all instances of GUI components get destroyed.

A common pattern is to create State on stack before entering message loop:

int main() {
  nu::State state;

  // Enter message loop.
  MessageLoop().Run();

  return 0;
}

It is safe to leak it if you can't or don't want to clean up resources on exit.

Constructors

State()

Create global state, each thread can only have one State.

Class methods

State* GetCurrent()

Return the global state of current thread.

Return

State*