StatusBar
The classic application status bar: a message area on the left, optional
named parts on the right (separated cells — line/column, encoding, …), an
on-demand progressbar, and a window sizegrip. Pack it at the bottom
with fill: 'x' and it looks the part in every theme.
Live preview
Live preview. In the Player's built-in docs viewer (
scriptweaver --help), this rendersStatusBaras a live, theme-aware widget you can interact with.
Example
const sb = app.StatusBar({ text: 'Ready' });
sb.pack.configure({ side: 'bottom', fill: 'x' });
sb.set('pos', 'Ln 1, Col 1'); // named right-side cells
sb.set('enc', 'UTF-8');
sb.text = 'Indexing…'; // announced to screen readers (a status live region)
sb.progress = 40; // shows the bar at 40%
sb.progress = 'busy'; // indeterminate activity
sb.progress = ''; // hides it again
Parts
sb.set(name, text) creates a cell on first use and updates it after; cells
display left-to-right in creation order, each with its own separator.
sb.remove(name) deletes one (removing an unknown name is a no-op);
sb.parts lists the names in order. Names use letters, digits, _ or -.
Progress
progress value |
Meaning |
|---|---|
'' (default) / null |
Hidden. |
0 … 100 |
Determinate bar at that percentage. |
'busy' |
Indeterminate activity animation. |
When sw.app.reducedMotion is true, 'busy' shows a static bar instead of
animating — set it from your app's accessibility preferences.
Options
| Option | Type | Description |
|---|---|---|
text |
string | The main message. Changes are announced politely (the bar's accessible role is status). |
progress |
string/number | See the table above. |
sizegrip |
boolean | Show the resize grip at the far right (default true). |
Other Frame options (padding, style, cursor, …) are
accepted and delegated. Nothing in a status bar takes keyboard focus.
See also
Progressbar— a standalone progressbar- Accessibility — announcements, reduced motion
- Layout —
packand friends