inspector

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2026 License: BSD-3-Clause Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package inspector provides an opt-in, read-only runtime widget-tree inspector for debugging Bellui layouts — the human-facing counterpart to the accessibility introspection layer.

Call Show with the window you want to inspect:

func main() {
    a := app.New()
    w := a.NewWindow("My App")
    w.SetContent(buildUI())

    if os.Getenv("BELLUI_INSPECT") == "1" {
        inspector.Show(w) // opens the inspector in its own window
    }
    bellui.ShowAndRun(w)
}

The inspector window shows:

  • a tree pane: the live object tree of the target (the same walk used by the painter and hit-test, descending both containers and widget-renderer internals), rebuilt on demand via the Refresh button — there is no ticker, so a closed inspector costs nothing;
  • a detail pane: Position/Size/MinSize (dp), absolute bounds, visibility, clip bounds, scroll offset, direction-scope and theme-override presence, and the accessibility snapshot (role/label/value) of the selected node;
  • a bounds highlight drawn as an overlay on the target when a node is selected;
  • a pick mode (the Pick button): hover the target to preview the object under the cursor, click to select it in the tree, Escape to cancel.

Everything the inspector adds to the target is removed when the inspector window closes.

This package is heavy relative to core and is only linked into a binary that imports it — mirroring theme/cjk. Phase 1 is desktop-only (its own window); mobile and wasm are single-window and out of scope.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inspector

type Inspector struct {
	// contains filtered or unexported fields
}

Inspector is a live, read-only view of a target window's widget tree. It opens in its own window with a tree pane, a detail pane and a pick mode that resolves the object under the cursor on the target. Create one with Show.

func Show

func Show(w bellui.Window) *Inspector

Show opens an inspector window targeting w and returns it. Call it on the main goroutine (the same goroutine that runs the Bellui event loop); the inspector reads the target's live geometry directly. Phase 1 is desktop-only — on single-window platforms (mobile, wasm) a second window is not available.

The inspector adds no overhead to the target until something is selected or pick mode is armed, and removes everything it added when its window closes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL