Import std.term.widgets
ProgressBar
class
Public Class ProgressBar
A bar of how much of a Total is done, on a line of its own, with a Label before it and its Parts after it, which it draws again in place as its Value changes, no more often than Interval but at its start and its end, on an interactive terminal; on another, it's drawn once, at its Finish. It goes to stderr, or to a Terminal given. What reads the clock also takes an Instant, so a test gives the time.
Examples
Local terminal = FakeTerminal(interactive: False)
Local bar = ProgressBar(10, terminal)
bar.Add(4)
Expect(bar.Value == 4 && !bar.IsFinished)
bar.Finish()
Expect(bar.IsFinished)-
How many make the bar full.
-
What goes before the bar.
-
The bar's columns, which give way to the rest where the terminal's line is narrower.
-
What follows the bar.
-
The bar's characters: a full column first, an empty one last, and any between, for a column that's partly full, from the fullest down, as "█▉▊▋▌▍▎▏ " or "#>-" has them.
-
How its full and its empty columns look.
-
How its empty columns look.
-
The least time between two draws.
-
A bar of
totalon stderr, from now. -
A bar of
totalonterminal, from now. -
A bar of
totalonterminal, fromstart. -
How many are done.
-
Whether Finish has drawn it for the last time.
-
Sets how many are done, and draws it, if it's time to.
-
Sets how many are done at
now, and draws it, if it's time to. -
Adds
countto how many are done, and draws it, if it's time to. -
Adds
countto how many are done atnow, and draws it, if it's time to. -
Writes
texton a line of its own above the bar, which is drawn again below it. -
Writes
texton a line of its own above the bar atnow. -
Draws it for the last time, as it is, and ends its line.
-
Draws it for the last time at
now, and ends its line. -
The line it draws at
now, as its terminal shows colors, in its columns.
Report an issue with this page or with FutureBlitz on GitHub.