Skip to content

v0.5.0 — 35 widgets · GTK-theme aware · 100 % coverage

Choose a tag to compare

@tannevaled tannevaled released this 01 Jul 14:43

First tagged release of the toolkit under its go-widgets org home.

Highlights

  • 35 widgets across Base / Text / Action / Input / Selection / Layout / Tabs / Scroll / Feedback / Navigation / Bars / Composite families (see README table)
  • LoadGTKTheme(css) — parses libadwaita / GTK3 @define-colorTheme, with alias-chain resolution (fixed-point iteration, cycle-safe)
  • 10 stock icon helpersDrawIcon{New,Open,Save,Cut,Copy,Paste,Undo,Redo,Search,Settings}, 1-px pixel-art strokes, scale-fit
  • Notification widget — auto-dismissing toast driven by Tick()
  • IME event kinds on TextViewEventCompositionStart / Update / End for dead-key + CJK candidates
  • MenuBar.HandleShortcut(code) — accelerator dispatcher
  • MenuBar.NameWidth / NameOriginX — exports for hosts that render their own popover under a clicked name
  • MenuBar auto-sized top-level names — no more clipped "Long Menu Name"

Metrics

  • 100.0 % of statements covered by unit tests
  • Pure Go, stdlib only, CGO=0
  • Builds for GOOS=js GOARCH=wasm + every native target Go ships
  • BSD-3-Clause

Consumers

  • gallery — browser wasm live demo hosting the full widget family on a plain canvas. Live at go-widgets.github.io/gallery/.
  • svg — one-function package that wraps any toolkit render in a self-contained SVG (base64 PNG inside a scaling envelope).

Use

import "github.com/go-widgets/toolkit"

btn := toolkit.NewButton("Click me", func() { println("clicked!") })
btn.SetBounds(toolkit.Rect{X: 20, Y: 20, W: 120, H: 28})
surface := make([]byte, 4*w*h)
btn.Draw(surface, w, toolkit.DefaultLight())

Next

go-widgets/tui — planned terminal-cell backend. v0.5.x point releases will land bug fixes + backward-compat additions; API-breaking changes wait for v0.6.