std :: gui::gui_app
Struct std::GuiApp
struct GuiApp {
struct Vec<&GuiAppWindow> windows;
struct Vec<struct GuiTimer> timers;
unsigned int nextTimer;
int quitting;
int exitCode;
double frameMs;
double lastFrame;
}Fields
Methods
Opens a window (hiDpi). null if there's no display / it failed.
Destroys the window (and its widget tree, if any) now.
Shows 'root' in the window (the window owns the tree from now on: closing the window frees it). Returns the window's GuiUi.
Repaint the window on the next iteration.
generic<T> void on_event(
&GuiWindow win,
fn int(&GuiApp, &GuiWindow, &GuiEvent, ?&T) cb,
?&T data,
)source · definitionEvery event for the window (after its widgets saw it): return 1 if you handled it (the window is repainted).
generic<T> void on_draw(
&GuiWindow win,
fn void(&GuiApp, &GuiWindow, &GuiCanvas, ?&T) cb,
?&T data,
)source · definitionCustom drawing, each repaint.
generic<T> void on_frame(
&GuiWindow win,
fn int(&GuiApp, &GuiWindow, double, ?&T) cb,
?&T data,
)source · definitionAnimation: called every frame with the time in ms while it returns 1.
generic<T> unsigned int set_timeout(
double ms,
fn void(&GuiApp, unsigned int, ?&T) cb,
?&T data,
)source · definitiongeneric<T> unsigned int set_interval(
double ms,
fn void(&GuiApp, unsigned int, ?&T) cb,
?&T data,
)source · definitionOne iteration: wait up to 'timeoutMs' (0 = don't wait, negative = as long as nothing is due) for events, route them, run due timers and frame callbacks, repaint and present what changed. Returns 0 once the app should stop (quit() was called or no window is left).
pump() until it returns 0; returns the exit code given to quit() (0 when the last window closed).
gui_time_ms()
Closes every window and frees the app's state.
= drop()