C+
Packages · View as Markdown
v0.0.27 is a macOS / AppKit release. That is the supported path. Other platforms are not recommended; wait for a later version.

facet_appkit

The macOS backend for facet. facet owns the description tree and all layout (flex_layout). This package fills the backend seams: Renderer, scheduler, key reader, sender readers, and theme slots.

The public surface is install() (and installed() / uninstall()). There is no render and no run(tree).

import "facet_appkit/facet_appkit" as backend;
import "facet/runtime" as runtime;
import "stdlib/status" as status;

fn main() -> i32 {
    backend::install();
    var app: runtime::App = runtime::App::new("hello");
    app.screen("home", home_screen);
    return match app.run("home") {
        status::Status::Ok => 0,
        _other => 1,
    };
}

install is idempotent. It arms the mount renderer, the UI-thread assert, the run-loop observer that syncs dirty nodes, and the reactor pump so spawn_ui tasks resume. Agent serving is not installed here: call facet/agent::enable() before app.run if the app should serve.

Deps: objc, appkit, quartzcore (NSView.layer() is a real CALayer), flex_layout, facet, webkit (for web / hybrid_web).

macOS only. The same facet tree is drawn on Linux by facet_gtk. To drive a running AppKit app from an external agent, see the agent surface.