JFLib

Writing an app with JFLib (Rust)#

This guide is for developers and AI models writing desktop apps with JFLib. There are two ways to write one, and the code is the same in both:

  • An app of your own, with the crate jflib: one dependency, Cargo builds it, and cargo jflib (cargo install cargo-jflib) makes the project, runs its tests, reloads it while you edit, builds it for the browser, Android and macOS and packages it. Start with cargo jflib new NAME.
  • An app inside this repository (apps/NAME), built by build_rs.py, which builds the library and every app of the repository through Cargo.

Where the two differ, this guide shows the crate way first. Look up functions in API.md (generated from the sources), and look at apps/gallery for every control in use. How widgets look is the business of the linked style (STYLES.md); packaging is in PACKAGING.md, what the crates promise in VERSIONING.md. The library itself is described in README.md.

The examples below were compiled and run against the library (R13); identifiers such as ID_*, CMD_* and the fields of self are the example app's own.

Sections

Source: docs/GUIDE.md in the JFLib repository.