Skip to content
This repository was archived by the owner on Nov 22, 2026. It is now read-only.

mojo-imkit v0.7.2

Choose a tag to compare

@amarbarosys amarbarosys released this 08 Nov 23:02
· 21 commits to main since this release

mojo-imkit-public v0.7.2

Released: 2026-11-08 · Commit: 7b7cf08 · Previous: v0.6.4

What it does

An immediate-mode GUI for Mojo apps, drawn by one GPU compose kernel over the app frame. System SDL3 presents the window and FreeType builds the glyph atlas.

Highlights

  • Layer.set_image(px, w, h): one call puts a large picture (up to UI_IMG pixels) in the image pool.
  • Ui.field and Input.text: a single-line ASCII text box fed by SDL text events; Window.text_input(on).
  • Window.push(EV_TEXT, text=...) delivers the text it was given, also when the string is built at run time.
  • Ui.button takes a color.

Changes

Added

  • Layer.set_image, layer.image_fits; Input.text (default empty), Window.text_input(on), EV_TEXT, Window.push(EV_TEXT, text=...); Ui.field, Ui.field_focused; scripts/mutants.sh.

Changed

  • Ui.button takes a color (default: the accent). Input has an explicit constructor so text can default; every existing Input(...) call builds unchanged.

Fixed

  • Window.push(EV_TEXT) handed SDL a pointer into a string freed when push returned; SDL reads it at poll(). A literal hid the bug; a run-time string polled back garbage. Window now keeps the bytes alive until poll() has read them.

Verified

Check Result
scripts/ci.sh steps on this tree (precompile, build of every test and the quickstart, font_test, ui_cpu_test, quickstart), Mojo 1.2.0 all exit 0
scripts/local_gate.sh under gpu-wait on gfx1100, KDE Wayland (ui_test on the GPU, window_test on the display, audio_test) PASS local_gate: ui_test, window_test, audio_test
scripts/mutants.sh: field ignores max; Input.merge drops text; pushed text freed before poll all killed, PASS mutants
pkg-conda dry run on the version commit (H1-H3,H6) PASS: mojo-imkit-0.7.2-hb0f4dca_0.conda

Known limits

  • Ui.field: append and Backspace at the end only; no cursor movement, selection, paste, key repeat or non-ASCII. Fixed width 360.
  • Input.text carries UTF-8 as SDL sends it; field drops every byte outside 32-126.
  • This release carries the work developed as v0.7.0 and v0.7.1 in the dev repo (never published; renamed dev-v0.7.0, dev-v0.7.1 there).

Upgrade / run

None for existing code: `Ui.button` and `Input(...)` calls build unchanged.

Commits

  • 7b7cf08 build: bump version to 0.7.2
  • 1514006 feat: typed text, text fields, set_image, button colour (dev v0.7.0 and v0.7.1 work)