nx_ui.nx source
↩ module page · 16 lines · 698 B
1// nx_ui.nx -- demo of the sovereign interactive frontend (renders to stdout).
2// The REUSABLE render lives in nx_ui_lib.nx -- composed here AND by the live
3// server nx_ui_serve.nx (one render, no one-offs). license_tier: ORIGINAL
4
5import "nx_ui_lib.nx"
6
7func main() -> i64 {
8 // render to stdout (fd 1); the server passes a connection fd to the same calls.
9 ui_w(1, "==== STATE A: torso selected, zoom 1 ====\n")
10 ui_emit_region_map(1, 1, 1)
11 ui_w(1, "\n==== STATE B: head clicked, zoomed to 2 ====\n")
12 ui_emit_region_map(1, 0, 2)
13 ui_w(1, "\n==== STATE C: handle query 'region=4&zoom=2' (the full loop) ====\n")
14 ui_handle_query(1, "region=4&zoom=2" as *u8)
15 return 0
16}