Skip to content
FutureBlitz

    Install

    Import std.term.widgets

    Spinner

    std.term.widgets

    class

    Public Class Spinner

    A spinner, on a line of its own, whose frame turns each Interval, with its Message after it, for work whose end isn't known. Tick draws it again when its frame or message has changed, on an interactive terminal; on another, only its Finish's line is written. It goes to stderr, or to a Terminal given. What reads the clock also takes an Instant, so a test gives the time.

    std/term/widgets.fb, line 687

    • Public Field Frames: String[] field #

      What it shows, one frame after another.

    • Public Field Message: String field #

      What goes after it.

    • Public Field Interval: Duration field #

      How long each frame shows.

    • Public Field FrameStyle: Style field #

      How its frame looks.

    • Public New(message: String) constructor #

      A spinner on stderr, from now.

    • Public New(message: String, terminal: Terminal) constructor #

      A spinner on terminal, from now.

    • Public New(message: String, terminal: Terminal, start: Instant) constructor #

      A spinner on terminal, from start.

    • Public Property IsFinished: Bool property #

      Whether a Finish has written its last line.

    • Public Method Tick() method #

      Draws it again, when its frame or its message has changed since it last was.

    • Public Method Tick(now: Instant) method #

      Draws it again at now, when its frame or its message has changed.

    • Public Method Finish(text: String) method #

      Takes it away, and writes text on its line, which ends.

    • Public Method Succeed(text: String) method #

      Finishes it with a green ✔ before text.

    • Public Method Fail(text: String) method #

      Finishes it with a red ✖ before text.

    Report an issue with this page or with FutureBlitz on GitHub.