Window_Creation module

Window_Type

constantSource

The native window handle. Its type depends on the target: an X11.Window (an integer) on Linux, an HWND on Windows, and a pointer on macOS (*NSWindow) and Android. So "no window" is 0 in one place and null in another, and window == null does not compile on Linux.

To stay portable, never write the literal. A variable of the type starts as "no window" on every target, and WT.INVALID_WINDOW is the same value as a constant to compare against or assign. Handles compare with == on all targets.

Example
no_window: Window_Type;
assert(no_window == WT.INVALID_WINDOW);

window := no_window;
if window == WT.INVALID_WINDOW window = no_window;

Doesn't run in the browser (skipped on wasm).

Window_Type :: u64

See also