Files
adminandClaude Opus 5.5 e538cf74e8 Reaktor names, faster frames, services, list and splitter, a clearer tree
Names: applications see only reaktor_ names. include/reaktor/nuklear.h
aliases the Nuklear types, constants and calls the samples use, so values
mix freely with nk_*. The samples and public headers use them throughout;
colour and CENTRE are color and CENTER.

Speed: the web accessibility tree moves only the nodes out of place, the
style cache is a hash table with no size cap, wrapped labels keep their
line breaks, and screen-reader lookups in the snapshot are indexed.

Features: reaktor_file_dialog_open (open, many, save, folder, filters),
reaktor_ask, reaktor_timer and reaktor_post, settings with remembered
window geometry, reaktor_list (sheet-styled, only the visible rows, keys
move the selection), reaktor_splitter (drag or arrow keys), .tooltip,
PNG and JPEG through .src, a link's .url, and REAKTOR_CURSOR_*. The quit
confirmation is a reaktor_ask. A root box that fills is as wide as its
panel. Dead code is gone: css_field, unused App fields, duplicate helpers.

Tree: src/ is gone (core/internal.h), core/base/util.h, render/svg.c, the
tests in tests/, assets/css/reaktor.css. app.c hands input to input.c;
declare.c keeps the frame and boxes, controls.c and views.c the widgets.
NukAnim's switch is now nka_set_keep_at_rest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 09:10:21 +02:00

39 lines
950 B
C

#include "reaktor/reaktor.h"
#include "reaktor/main.h"
static void
page_shell(App *app, struct reaktor_context *ctx, int win_w, int win_h)
{
(void)ctx;
REAKTOR_FREE(.w = (float)win_w, .h = (float)win_h) {
if (reaktor_button(&(reaktor_button_spec){
.label = "Close",
.keys = "Escape",
.box = { .w = 160.0f, .h = 40.0f,
.ml = (win_w - 160.0f) * 0.5f,
.mt = (win_h - 40.0f) * 0.5f } }))
reaktor_request_quit(app);
}
}
static int
sample_key(App *app, const SDL_Event *e)
{
if (reaktor_chord(e, 0, SDLK_ESCAPE)) {
reaktor_request_quit(app);
return 1;
}
return 0;
}
int
main(int argc, char **argv)
{
return launchApp(argc, argv, &(reaktor_launch){
.name = "Simple",
.window = { .w = 340, .h = 180 },
.page = page_shell,
.key = sample_key });
}