Skip to content

Status Bar View

A status bar view (%SB) is a single-line view that operates in one of two modes:

  • Single mode (no panels option): behaves like a TextView with an optional timed auto-refresh. Useful for clocks, counters, and other self-updating labels.
  • Panel mode (panels array): the view is divided into independently-addressable named slots, each with its own width, alignment, color, fill character, and optional auto-refresh template. Code updates individual panels via setPanel() / setPanels() without touching the others.

The text property is treated as a format template: it is re-evaluated on every refresh tick so that embedded MCI codes (e.g. {CT} for current time, {AN} for active node count) always reflect up-to-date values.

PropertyDescription
textFormat template for the label. Supports pipe color codes and any predefined MCI code in {CODE} syntax (e.g. {CT}, {UN}, {AN}).
widthWidth of the view in columns (default: 15).
refreshIntervalMilliseconds between automatic refreshes (default: 0 — no auto-refresh). Set to e.g. 1000 to refresh every second.
textStyleStandard (non-focus) text style. See Text Styles in MCI.
justifyText justification: left (default), right, or center.
fillCharCharacter used to fill unused space (default: space).
textOverflowCharacters to display when text is longer than width. See Text View for details.

Any predefined MCI code wrapped in { } is substituted each refresh cycle. For example:

text: "|07Time: |15{CT}|07 Nodes: |15{AN}"

See MCI Codes for the full list of available predefined codes.

%SB1%SB1
Configuration fragment (expand to view)
SB1: {
text: "|07{DT} {CT} [{AN} active]"
width: 40
refreshInterval: 1000
justify: right
}

Panel mode divides the view into independently-addressable slots. Each panel has its own fixed or fill width, alignment, color, and optional auto-refresh template. Code updates individual panels by name or index via setPanel() / setPanels().

PropertyDescription
panelsArray of panel configuration objects. Presence of this key activates panel mode.
widthTotal width of the entire status bar in columns.
anchorleft (default) or right — which end panels[0] is attached to. right reverses draw order so the first panel in the config is the rightmost one.
justifyHow the panel group sits within the total view width: left (default), center, or right.
separatorPipe-code string drawn between panels (default: ""). Example: " " for a single space.
PropertyDescription
nameString key for setPanel('name', value) calls from code. Falls back to index if omitted.
widthFixed number of columns, or "fill" (one fill panel allowed per SB — takes remaining space).
justifyAlignment within the panel slot: left (default), center, or right.
styleSGR1Pipe-code string for the panel’s text color (e.g. |09 for bright blue).
textStylenormal, bold, reverse, upper, lower, etc. Applied via stylizeString.
fillCharPipe-code string for the pad character (e.g. |08· for a dim dot). Default: space.
overflowclip (default — truncate from right) or clip-left (truncate from left).
textStatic or format template for the panel’s initial value. Supports pipe codes and {CODE} MCI tokens. If refreshInterval is also set the panel auto-refreshes on a timer; without it the value is evaluated once at init and remains fixed (until setPanel() overwrites it).
refreshIntervalms between auto-refreshes for this panel. Overrides the SB-level default. 0 = event-driven only.

For panels driven from module code rather than auto-refresh templates:

// Update one panel by name (or by index if a number is passed):
statusBarView.setPanel('mode', 'INS');
statusBarView.setPanel('pos', '01,01');
// Update multiple panels with a single redraw:
statusBarView.setPanels({ mode: 'OVR', pos: '12,40' });

Values passed to setPanel / setPanels are processed through pipe-code conversion and textStyle — plain strings are fine for simple indicators.

The full-screen editor (fse.js) uses a single %SB1 in MSGEFTR.ANS to display the cursor position and insert/overtype mode indicator side-by-side:

%SB1%SB1
Configuration fragment (expand to view)
2: {
mci: {
SB1: {
width: 9
anchor: left
justify: left
separator: " "
panels: [
{
name: mode
width: 3
justify: right
}
{
name: pos
width: 5
justify: left
}
]
}
}
}

This produces output like INS 01,01 (3-char mode panel + 1-char separator space + 5-char position panel). The mode and pos panels are updated from code via setPanel('mode', 'INS') and setPanel('pos', '01,01').

To add static label prefixes entirely from config, give each panel a text value and widen accordingly:

panels: [
{
name: modeLabel
width: 4
text: "md: "
}
{
name: mode
width: 3
justify: right
}
]