Outdated egg!

This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for the CHICKEN 5 version of this egg, if it exists.

If it does not exist, there may be equivalent functionality provided by another egg; have a look at the egg index. Otherwise, please consider porting this egg to the current version of CHICKEN.

  1. Outdated egg!
  2. progress-indicators
    1. Introduction
    2. Usage
    3. Requirements
    4. Documentation
    5. Author
    6. License
    7. Version History

progress-indicators

Introduction

Shows text-mode progress-indicators.

Usage

 (require-extension progress-indicators)

Requirements

defstruct

Documentation

[procedure] (make-progress-bar #!key fill empty head frame value max width port end-message)

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"
[procedure] (progress-bar? X)

Returns #t if X is an object representing a progress-bar, or #f otherwise.

[procedure] (progress-bar-value PBAR)

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)
[procedure] (show-progress-bar PBAR)

Redisplays the progress-bar PBAR.

[procedure] (advance-progress-bar! PBAR [AMOUNT])

Increases the current value of the progress-bar PBAR by AMOUNT, which defaults to 1 and redisplays it.

[procedure] (finish-progress-bar! PBAR [CLEAR])

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.

[procedure] (make-spinner #!key value port steps)

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)
[procedure] (spinner? X)

Returns #t if X is an object representing a spinner, or #f otherwise.

[procedure] (advance-spinner! SPINNER)

Advances the given spinner by 1 step and redisplays it.

[procedure] (finish-spinner! SPINNER)

Clears the spinner. It should not be used after this procedure has been called.

Author

felix winkelmann

License

This code is placed into the public domain.

Version History

0.3
added missing license information
0.2
added optional "clear" argument to finish-progress-bar!
0.1
initial release