((section 2 "Outdated egg!" (p "This is an egg for CHICKEN 4, the unsupported old release.  You're almost certainly looking for " (int-link "/eggref/5/progress-indicators" "the CHICKEN 5 version of this egg") ", if it exists.") (p "If it does not exist, there may be equivalent functionality provided by another egg; have a look at the " (link "https://wiki.call-cc.org/chicken-projects/egg-index-5.html" "egg index") ". Otherwise, please consider porting this egg to the current version of CHICKEN.") (tags "egg") (toc)) (section 2 "progress-indicators" (section 3 "Introduction" (p "Shows text-mode progress-indicators.")) (section 3 "Usage" (pre " (require-extension progress-indicators)")) (section 3 "Requirements" (p (int-link "defstruct"))) (section 3 "Documentation" (def (sig (procedure "(make-progress-bar #!key fill empty head frame value max width port end-message)" (id make-progress-bar))) (p "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:") (table (tr (td (tt "fill")) (td (tt "#\\="))) "\n" (tr (td (tt "empty")) (td (tt "#\\space"))) "\n" (tr (td (tt "head")) (td (tt "#\\>"))) "\n" (tr (td (tt "frame")) (td (tt "\"[~a~a~a~a|~a]\""))) "\n" (tr (td (tt "max")) (td (tt "100"))) "\n" (tr (td (tt "width")) (td (tt "60"))) "\n" (tr (td (tt "port")) (td (tt "(current-output-port)"))) "\n" (tr (td (tt "end-message")) (td (tt "\" finished\""))))) (def (sig (procedure "(progress-bar? X)" (id progress-bar?))) (p "Returns " (tt "#t") " if " (tt "X") " is an object representing a progress-bar, or " (tt "#f") " otherwise.")) (def (sig (procedure "(progress-bar-value PBAR)" (id progress-bar-value))) (p "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):") (pre " (set! (progress-bar-value PBAR) VALUE)")) (def (sig (procedure "(show-progress-bar PBAR)" (id show-progress-bar))) (p "Redisplays the progress-bar " (tt "PBAR") ".")) (def (sig (procedure "(advance-progress-bar! PBAR [AMOUNT])" (id advance-progress-bar!))) (p "Increases the current value of the progress-bar " (tt "PBAR") " by " (tt "AMOUNT") ", which defaults to " (tt "1") " and redisplays it.")) (def (sig (procedure "(finish-progress-bar! PBAR [CLEAR])" (id finish-progress-bar!))) (p "Sets the value of " (tt "PBAR") " to the maximum, writes the " (tt "end-message") " and prints a newline. The progress-bar should not be reused after this procedure has been called. If " (tt "CLEAR") " is given and true, remove the bar.")) (def (sig (procedure "(make-spinner #!key value port steps)" (id make-spinner))) (p "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:") (table (tr (td (tt "steps")) (td (tt "\"|/-\\\\\""))) "\n" (tr (td (tt "port")) (td (tt "(current-output-port)"))))) (def (sig (procedure "(spinner? X)" (id spinner?))) (p "Returns " (tt "#t") " if " (tt "X") " is an object representing a spinner, or " (tt "#f") " otherwise.")) (def (sig (procedure "(advance-spinner! SPINNER)" (id advance-spinner!))) (p "Advances the given spinner by 1 step and redisplays it.")) (def (sig (procedure "(finish-spinner! SPINNER)" (id finish-spinner!))) (p "Clears the spinner. It should not be used after this procedure has been called."))) (section 3 "Author" (p (int-link "/users/felix winkelmann" "felix winkelmann"))) (section 3 "License" (p "This code is placed into the public domain.")) (section 3 "Version History" (dl (dt "0.3") (dd "added missing license information") (dt "0.2") (dd "added optional \"clear\" argument to " (tt "finish-progress-bar!")) (dt "0.1") (dd "initial release")))))