loom & weft
Made for Swift.

Unreleased APIs from PR #2. Not in 0.2.1. Stable 0.2.1 reference.

LOOM Unreleased (PR #2) / ADDITIONAL WIDGETS AND TEXT

Gauge

A horizontal progress bar with eighth-cell precision and a centered optional label.

Standard inherited Swift protocol operations such as synthesized equality and OptionSet set operations are not repeated. The public declarations below are extracted from the exact source revision listed in the coverage manifest.

Members on this page

Feature guides and release status

Gauge

Structure
struct Gauge

Conforms to: Widget.

A horizontal progress bar with eighth-cell precision and a centered optional label.

Source · Gauge.swift:2

ratio

Instance Property
var ratio: Double

A public field of this type. Its value type and mutability are shown in the declaration.

Source · Gauge.swift:3

label

Instance Property
var label: String?

Visible item label.

Source · Gauge.swift:4

style

Instance Property
var style: Style

Visual attributes used when painting this value.

Source · Gauge.swift:5

filledStyle

Instance Property
var filledStyle: Style

A public field of this type. Its value type and mutability are shown in the declaration.

Source · Gauge.swift:6

labelStyle

Instance Property
var labelStyle: Style

A public field of this type. Its value type and mutability are shown in the declaration.

Source · Gauge.swift:7

init(ratio:label:style:filledStyle:labelStyle:)

Initializer
init(ratio: Double, label: String? = nil, style: Style = Style(), filledStyle: Style = Style(), labelStyle: Style = Style())

Creates a value with the supplied arguments. Default arguments are shown in the declaration.

Parameters (5)
ratio
Argument type and any default are shown in the declaration; see the behavior notes above.
label
Argument type and any default are shown in the declaration; see the behavior notes above.
style
Text/cell appearance.
filledStyle
Argument type and any default are shown in the declaration; see the behavior notes above.
labelStyle
Argument type and any default are shown in the declaration; see the behavior notes above.
Source · Gauge.swift:9

render(in:buffer:)

Instance Method
func render(in area: Rect, buffer: inout Buffer)

Paints this widget into the assigned terminal-cell rectangle. Application code owns state, input routing, and terminal lifetime.

Parameters (2)
in
Argument type and any default are shown in the declaration; see the behavior notes above.
buffer
Mutable destination cell grid.
Source · Gauge.swift:20