Skip to content

Widgets

Widget reference pages describe behavior and public shapes as implemented in the FlashBang library. Each page names the src/widgets/<name>.odin file that is the source of truth.

Conventions

  • Call widgets with ^ImmediateContext from flashbang.get_imm_ctx() after set_immediate_context each frame (see Immediate mode).
  • flashbang.odin re-exports stable names (Button, Label, …). Prefer importing flashbang from application code.
  • Config structs hold layout (x, y, w, h), optional id for dimension lookup and layout-backend overrides, and optional Maybe(style.Color) overrides where supported.
  • State structs (when present) are outputs for this frame; any round-trip fields (e.g. was_active, text buffers) are documented on the widget page.

Pages

Fully written reference (from source):

  • common — shared helpers: emit_surface, emit_separator, layout override, dimension getters.
  • buttonButton / ButtonConfig / ButtonState; also where ImmediateContext lives.
  • labelLabel / LabelConfig.

Other files below are stubs until expanded; use the linked .odin file and flashbang.odin exports in the meantime.

All widgets