Skip to content

Repository files navigation

Lightfast

Small, direct Common Lisp bindings for FLTK 1.4.

Requires SBCL with ASDF and CFFI, FLTK 1.4 with fltk-config, and a C++17 compiler.

make
make smoke
make layout-smoke
make widget-smoke
make demo
(asdf:load-system :lightfast)

The cl-fltk ASDF system and package nickname are aliases for Lightfast.

Automatic layout

Lightfast includes a deterministic, single-line flex layout engine for ordinary nested rows and columns. It supports:

  • padding and gaps
  • natural or fixed bases
  • weighted growth and shrinking
  • minimum and maximum dimensions
  • justification
  • cross-axis alignment

Layout calculation is pure. Applying it to FLTK widgets is a separate operation.

(let ((layout
(lightfast:make-layout-column
:padding12:gap8:children
(list
(lightfast:make-layout-item toolbar :basis32:shrink0)
(lightfast:make-layout-row
:grow1:gap8:children
(list
(lightfast:make-layout-item sidebar :basis220)
(lightfast:make-layout-item preview :basis0:grow1)
(lightfast:make-layout-item inspector :basis280)))
(lightfast:make-layout-item status :basis24:shrink0)))))
(lightfast:layout-on-resize window layout))

Use compute-layout for display-independent rectangle calculation and apply-layout for explicit widget resizing. Container nodes may have a target group; their descendants are then calculated in that group's local coordinate space.

About

FLTK bindings for Common Lisp with QOL tools

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages