Skip to content

StatusBar

phroun edited this page Aug 22, 2026 · 1 revision

Wire names statusbar · section · span

The bar along the bottom of an application. It holds sections; a section holds text, or spans of separately coloured text.

sb=new statusbar children={
	new section text="Ready" stretch
	new section text="Ln 1, Col 1" width=96 align=right
}

A status bar is top-level

Like a MenuBar, a statusbar is built as its own top-level object rather than inside a window's children, and the display adopts it as the connection's chrome:

w=new window title="My App" main children={ new panel layout=vbox children={ … } }
sb=new statusbar children={ new section text="Ready" stretch }

Properties

section

Property Type Default Meaning
align left | center | right Text alignment within section
stretch flag Section grows to fill space
text string Section text (spans take precedence)
width int Section width in units

span

Property Type Default Meaning
bg color Span background color
fg color Span foreground color
text string Span text

statusbar itself takes no properties.

All three are virtual types, so none of them takes the common properties.

Events

statusbar emits no events.

Structure is enforced

A status bar holds sections, and a section holds spans. Anything else is rejected by name:

new statusbar children={ new label caption="x" }
  ->  statusbar: children must be sections, got *trinkets.Label

Sizing sections

width is in units. stretch makes a section take the leftover room instead — it is a flag, not a weight, and it works by setting the section's width to a sentinel rather than by competing with siblings.

align is left, center or right. It is not the common align, which has seven values; a section's has three, and align=middle is rejected.

Spans

A section's text is the simple case. For a section whose parts are coloured differently, give it spans instead:

new statusbar children={
	new section children={
		new span text="ok " fg=green
		new span text="3 errors" fg=red
	}
}

Spans take precedence over the section's own text, so a section with both shows the spans.

fg and bg on a span take the same values as everywhere else — a named colour as a bare word, or a quoted "#rrggbb". See Common Properties.

See also

MenuBar — the other top-level chrome · Window · ProgressBar

Clone this wiki locally