find_package asks for 0.10, and the benchmark rows are 0.10.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 KiB
Frequently asked questions
Short answers, each linking to the part of DOCUMENTATION.md that covers it in full. Something missing? Open an issue.
What and why
- What is Reaktor, and how is it different from Nuklear?
- Why C99 and an immediate-mode core instead of a retained toolkit like GTK or Qt?
- Which platforms and architectures are supported?
- What license is it under?
Styling
- Why doesn't my CSS rule change a widget's size?
- Why can't I use
emorrem, and how far dovar()andcolor-mix()go? - How do I ship my own stylesheet or theme?
Layout and widgets
- Why does a widget have no rectangle, or the declared tree not settle?
- Can I still call Nuklear directly?
- How do I write a widget of my own?
Apps
- Where are settings stored, and when are they saved?
- How do settings work on the web?
- How do I make a splash screen, a frameless window or a tray icon?
- How do I open files, ask a question or post work from another thread?
- How do I add undo, notifications or printing?
Build and ship
- How do I build without CMake on PATH, or for x86 or ARM64?
- How do I turn off accessibility, localization or text shaping?
- How do I install libreaktor and link against it?
- How do I build and host the WebAssembly version?
- Why is the web page blank in a background tab?
Debugging
- How do I capture a screenshot or accessibility dump for a bug report?
- Should my app use a GPU renderer?
- Why is the frame time high on a machine with no GPU?
- Why does Japanese or Arabic text draw differently from Latin?
- How do I report a bug?
What and why
What is Reaktor, and how is it different from Nuklear?
Reaktor is a toolkit for building desktop and web apps in C. Nuklear, which it is built on, gives you widgets and leaves everything else to you. Reaktor fills in the rest:
- The whole stack, ready to use. Nuklear only draws; the window, input, fonts and rendering are yours to wire up. Reaktor brings them, built on SDL, so there is nothing to connect yourself.
- A finished app, not a drawing kit. One call opens a window and runs it; you describe what's on screen and Reaktor lays it out.
- A look you change without recompiling. Colors, fonts, spacing and rounded corners come from ordinary CSS files, with light and dark themes.
- Everyone can use it. Screen readers can read it, and every control works from the keyboard.
- Any language. Translations, number and date formats, and scripts such as Japanese and Arabic.
- What real apps need. Menus, file pickers, dialogs, notifications, undo, printing, saved settings, extra windows and a tray icon.
- One codebase everywhere. Windows, macOS, Linux, the BSDs and the browser.
Nuklear is still there underneath when you need something it offers directly. See An application.
Why C99 and an immediate-mode core instead of a retained toolkit like GTK or Qt?
To stay small: a 2.1 MB binary, 7–13 MB of RAM, no GPU, and nothing to install beside it. A frame is drawn only when something changes, so the app idles at 0% of a core. See The frame loop and PERFORMANCE.md.
Which platforms and architectures are supported?
Windows, macOS, Linux, FreeBSD, OpenBSD, NetBSD and WebAssembly, on x86 and ARM, plus ARMv7 and RISC-V on Linux. Every pull request builds them all; the BSDs' ARM64 runs under emulation and may fail without failing the run. See Platforms.
What license is it under?
MIT. Each dependency keeps its own license, all permissive; a release ships
them in licenses/ with NOTICE.md, and your app should carry
them too.
Styling
Why doesn't my CSS rule change a widget's size?
A size set in code beats the sheet: .box = { .h = N } locks CSS out of that
axis. Leave the axis unset and the rule applies. See
Styling.
Why can't I use em or rem, and how far do var() and color-mix() go?
You can: em is the body's font size and rem the root's. The engine also
resolves var(), works out color-mix(in srgb, …) and calc() over pixels,
and keeps the prefers-color-scheme branch for the active scheme. Percentages
are not lengths, and operator selectors such as [href^="http"] are dropped.
See Styling.
How do I ship my own stylesheet or theme?
Pass up to four sheets in .css; they are read after Water.css and
reaktor.css, and the last rule wins. reaktor_set_css swaps them at run time,
and --css adds one on top. .no_reaktor_css drops reaktor.css. See
Services and Styling.
Layout and widgets
Why does a widget have no rectangle, or the declared tree not settle?
A box is placed one frame late and found again by its name. A widget whose
label changes every frame needs a stable .name, and a node declared only on
some frames renumbers everything after it. A loose label after a row belongs
inside a named REAKTOR_COLUMN. See Layout.
Can I still call Nuklear directly?
Yes. Every Nuklear type and call has a reaktor_ alias, and nk_* stays
available. A declared tree and hand-laid reaktor_layout_row_* cannot share
a panel, but a group or popup is its own panel. See
Beyond the specs.
How do I write a widget of my own?
Lay it out by hand in a group, from the pieces in ui.h: colors from the
sheet, rounded fills and borders, a hot rectangle so hover redraws, and a
reaktor_note so screen readers and keyboard focus see it. See
Beyond the specs.
Apps
Where are settings stored, and when are they saved?
In settings.toml, a TOML file in SDL's preference folder for the app.
.save_settings picks when: never (the default), on quit, on every change,
or .save_ms after a change. reaktor_settings_save writes now and
reaktor_settings_clear empties them and deletes the file. See
Services.
How do settings work on the web?
The same settings.toml lives in the browser's IndexedDB, loaded before
main and synced after each write; saving on quit means saving on change
there. Clearing site data or closing a private window loses it.
How do I make a splash screen, a frameless window or a tray icon?
A window takes .borderless, .centered and .skip_taskbar; a splash
screen is those three on a window opened beside a .hidden main window.
reaktor_tray_open adds a tray icon with a menu. See
Windows and Tray.
How do I open files, ask a question or post work from another thread?
reaktor_file_dialog_open for the system's open, save and folder pickers,
reaktor_ask for a modal question, reaktor_timer for later, and
reaktor_post from any thread. Every callback runs on the main thread and is
followed by a frame. See Services.
How do I add undo, notifications or printing?
Push a step with an undo and a redo callback after each change, and Ctrl+Z
and Ctrl+Y take it back and forth, merging typing into one step if asked.
reaktor_notify shows a message outside the window. reaktor_print and
reaktor_print_pdf lay pages out as the window does and print them or write
a PDF. See Services.
Build and ship
How do I build without CMake on PATH, or for x86 or ARM64?
./build.ps1 on Windows finds MSVC's CMake; ./build.sh elsewhere.
./build.ps1 -Arch x86 or -Arch arm64 builds that architecture into
build-<arch>; ARM64 needs Visual Studio's ARM64 tools. See
Platforms.
How do I turn off accessibility, localization or text shaping?
-DREAKTOR_A11Y=OFF, -DREAKTOR_LOCALE=OFF or -DREAKTOR_TEXT=OFF. Each
swaps in a stub, and pixels and --a11y-dump stay identical apart from what
the module drew. CMake keeps the option until you pass =ON. See
Build options.
How do I install libreaktor and link against it?
Take the release's archive or the .deb or .rpm, or run
sh tools/libreaktor-pkg.sh -i. Then find_package(reaktor 0.10 REQUIRED)
and link reaktor::reaktor, or use pkg-config --cflags --libs reaktor. To
build it into your tree instead, add_subdirectory the checkout and call
reaktor_add_app. See In your own project.
How do I build and host the WebAssembly version?
./build-wasm.sh (or .ps1) with emsdk writes the pages into build-wasm/;
serve that folder over HTTP, since opening the file directly will not load.
See The web build.
Why is the web page blank in a background tab?
The loop waits on requestAnimationFrame, which a hidden tab, a minimized
window or an off-screen pane never fires. It draws once it is visible.
Debugging
How do I capture a screenshot or accessibility dump for a bug report?
./build/showcase --tab 7 --theme dark --shot a.bmp --a11y-dump a.txt
Any app takes --shot and --a11y-dump; the dump lists every node with its
bounds, so two dumps diff to the pixel. Settings are not read under either.
See Command-line flags.
Should my app use a GPU renderer?
Usually not. software, the default, needs no GPU, uses about a tenth of the
memory and starts fastest. A GPU
renderer pays off in long, continuous animation: --renderer gpu takes
Metal on macOS; on Windows OpenGL where the build has it, else Direct3D 12,
else 11, so directx on a default build; on Linux and the BSDs OpenGL, else
OpenGL ES 2, neither built unless REAKTOR_RENDERERS names it. Expect six
to thirteen times the memory. See
The renderer.
Why is the frame time high on a machine with no GPU?
Most of it is usually rasterizing: SDL queues what it is asked to draw and fills the
pixels when that queue is flushed. The rest is mostly copying the frame to the
window. The Diagnostics page and bench --no-vsync split build, render and
present. See The renderer.
Why does Japanese or Arabic text draw differently from Latin?
A string with a character the font atlas lacks is drawn by the Text module,
which orders, shapes and takes glyphs from fallback fonts; the rest is
Nuklear's. Arabic, Hebrew or an Indic script needs a font that has it, passed
with --font-fallback or .font_fallbacks. See Text.
How do I report a bug?
Open an issue at github.com/Alpaq92/Reaktor/issues
with the Reaktor version (reaktor_version()), the system and architecture,
the steps that show it, and what you expected. For anything drawn wrong,
attach a --shot and an --a11y-dump of it; for a crash, what the
--console debug log printed.