Shows text-mode progress-indicators.
- make-progress-bar #!key fill empty head frame value max width port end-messageprocedure
Creates an object representing a progress-bar. The keyword arguments customize the appearance of the progress-bar, when it is shown and default to the following values:
fill #\= empty #\space head #\> frame "[~a~a~a~a|~a]" max 100 width 60 port (current-output-port) end-message " finished"
- progress-bar? Xprocedure
Returns #t if X is an object representing a progress-bar, or #f otherwise.
- progress-bar-value PBARprocedure
Returns the current value of the given progress bar. You can also use SRFI-17 "setter" syntax to modify the current value (causing a redisplay):
(set! (progress-bar-value PBAR) VALUE)
- show-progress-bar PBARprocedure
Redisplays the progress-bar PBAR.
- advance-progress-bar! PBAR #!optional AMOUNTprocedure
Increases the current value of the progress-bar PBAR by AMOUNT, which defaults to 1 and redisplays it.
- finish-progress-bar! PBAR #!optional CLEARprocedure
Sets the value of PBAR to the maximum, writes the end-message and prints a newline. The progress-bar should not be reused after this procedure has been called. If CLEAR is given and true, remove the bar.
- make-spinner #!key value port stepsprocedure
Creates an object representing a "spinner" progress-indicator. The keyword arguments customize the appearance of the progress-bar, when it is shown and default to the following values:
steps "|/-\\" port (current-output-port)
- spinner? Xprocedure
Returns #t if X is an object representing a spinner, or #f otherwise.
- advance-spinner! SPINNERprocedure
Advances the given spinner by 1 step and redisplays it.
- finish-spinner! SPINNERprocedure
Clears the spinner. It should not be used after this procedure has been called.
This code is placed into the public domain.
- added missing license information
- added optional "clear" argument to finish-progress-bar!
- initial release