Skip to content

go-ruby-widgets

Three pure-Go, Ruby-runtime-independent adapters over the go-widgets stack, shaped so that go-embedded-ruby (rbgo) can bind each as require "widgets", require "tui" and require "mvvm":

Repo Adapts Role
widgets go-widgets/toolkit + go-widgets/painter A live pixel widget UI toolkit — buttons, labels, lists, menus and the container/layout system, rendered to an RGBA buffer
tui go-widgets/tui A terminal-cell UI toolkit — widgets, border/split/card layouts, rendered as an ANSI stream or a decoded cell grid
mvvm go-widgets/mvvm The data-binding layer — an Observable property, a Command action, an ObservableList collection

Each is a thin adapter: it exposes its underlying toolkit through Ruby-facing handles (Module, plus Widget/Font-style handles per repo) whose methods return Ruby-shaped values — a Hash (map[string]any), an Array ([]any) or a scalar. A single dynamic entry point, Call, dispatches a Ruby-style snake_case method name to the matching handle method and coerces the arguments, which is exactly what an rbgo binding drives from method_missing. Nothing in any of the three depends on the Ruby runtime, so each is equally usable as a standalone Go library — siblings of go-ruby-opentype, go-ruby-regexp and go-ruby-erb in the go-ruby-* family.

At a glance

  • CGO-free — builds and tests identically on amd64, arm64, riscv64, loong64, ppc64le, s390x (widgets also targets js/wasm, the wasmdesk target).
  • 100 % test coverage, race-clean, enforced in CI.
  • Handle-addressed object graphs. widgets and tui each own a live widget/container tree addressed by opaque handles; mvvm has no UI tree — just bindable Observable/Command/ObservableList primitives.
  • Two render seams, one data-binding seam. widgets.Render paints to an RGBA pixel buffer; tui.Render/RenderCells emit an ANSI stream or a decoded cell grid; mvvm.DrainEvents pulls a queue of callback-id-tagged event Hashes.

Install (Go)

go get github.com/go-ruby-widgets/widgets
go get github.com/go-ruby-widgets/tui
go get github.com/go-ruby-widgets/mvvm

See widgets, tui and mvvm for each adapter's full Ruby-facing surface, and Getting started in rbgo for the require workflow.