XU XUv0.8.8
中文

Docs /

UI / WebView

#ui provides windows, menus, tray icons, and the event loop. #ui/webview supplies HTML content and IPC; #ui/draw provides an immediate-mode canvas. Each app has main.xu, xu.xun, brand/, and optional www/ assets.

Desktop packaging uses xu-desktop beside the compiler. macOS produces .app bundles with AppKit/WebKit; Windows x64/arm64 produces .exe with native host code and WebView2; Linux x64/arm64 produces ELF using GTK4 and, for WebView, WebKitGTK 6.0. Matching compiler/linker and SDK dependencies are required: run xu doctor for the chosen target first.

# From the examples repository root
xu doctor --desktop --target macos-arm64
xu build examples/16_ui_webview/open --target macos-arm64 --desktop --output /tmp/XuOpen
open /tmp/XuOpen.app

brand/ must contain a PNG icon. www/ is embedded into the native artifact and served through xu://; remote HTTP(S) content is also supported. Cross-generation alone is not a target-machine runtime test. XU_UI_SIM=1 exercises the in-process simulation; missing host integration reports ui: host not available.

Desktop tutorial