-
Notifications
You must be signed in to change notification settings - Fork 0
StatusBar
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
}
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 }
| 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 |
| 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.
statusbar emits no events.
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
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.
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.
MenuBar — the other top-level chrome · Window · ProgressBar
KittyTK — image/tty Trinket Kit · MIT licensed · alpha, 0.1.x
Repository · Issues · Support on ko-fi
Sibling projects: PurfecTerm (terminal emulator) · mew (text editor) · PawScript (language)
Getting Started
Installation Building from Source Running a Display Host Your First Application Examples
Protocol
Protocol Overview Object Model Properties and Values Events Templates and Aliases Common Properties Introspection Transports and Security
Clients
Go Client Python Client C Client
Application Objects
Application · MenuBar · Window · MessageBox
Output Trinkets
Label · ProgressBar · StatusBar
Input Trinkets
TextInput · Editor · Terminal
Button · CheckBox · RadioButton
ListView · ComboBox · TreeView
Layout Trinkets
TabTrinket · Panel
ScrollArea · MDIPane
Separator · Spacer · Splitter
Other Trinkets
Layout Helpers