libs/ui
Immediate-Mode GPU Widget Toolkit
A fast, immediate-mode GUI toolkit tailored for developer tooling and high-frame-rate user interfaces. Eliminates synchronization headaches between UI state and widget trees by generating layout and drawing commands synchronously on every frame.


Sub-Millisecond Multi-Cursor Editing
Unlike line-array or gap-buffer architectures, the Kale Piece Table holds an immutable original file buffer coupled with an append-only edit buffer. Loading a 100MB file takes under 1ms because no memory copying occurs.
import "libs/ui/context.kl" as ui;
fn draw_control_panel(ctx: *ui.UIContext) -> void {
ui.begin_panel(ctx, "Command Center", 20.0, 20.0, 300.0, 400.0);
ui.label(ctx, "Build Configuration:");
if ui.button(ctx, "Compile Kale Monorepo") {
trigger_build();
}
ui.slider_f32(ctx, "Optimization Level", &opt_level, 0.0, 3.0);
ui.checkbox(ctx, "Emit LLVM IR Assembly", &emit_ir_flag);
ui.end_panel(ctx);
}Deterministic command-line invocations to build, link native dynamic dependencies, and run automated regression tests:
kale build tests/test_ui_widgets.kl -o bin/test_ui.exe -lglfw3 -lopengl32./bin/test_ui.exeGPG Key 1B917D4779A6102E • Continuous integration with automated symbol verification.
Stateless API powered by Murmur/FNV widget ID hashes tracking hovered, active, focused, and dragged controls.
Automatic bounding box calculation with padding, gap, alignment, and auto-wrapping containers.
Built-in support for classical dark midnight navy styling, imperial red accents, and gold active states.