diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-04-09 23:31:54 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-04-09 23:32:52 +0200 |
commit | dfaf59f93b0ddd77bb3c499c65b3404187a8740e (patch) | |
tree | a03664f5f160d96859bf87e2421113753ad591c4 | |
parent | Add mulit-set! (diff) | |
download | calp-dfaf59f93b0ddd77bb3c499c65b3404187a8740e.tar.gz calp-dfaf59f93b0ddd77bb3c499c65b3404187a8740e.tar.xz |
Add slightly better terminal drawing procedures.
Diffstat (limited to '')
-rwxr-xr-x | module/main.scm | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/module/main.scm b/module/main.scm index e7766b8e..909bac15 100755 --- a/module/main.scm +++ b/module/main.scm @@ -41,6 +41,13 @@ (define (now) (date->time-utc (current-date))) +(define (box-top intersection line . lengths) + (reduce (lambda (str done) (string-append done (string intersection) str)) + "" (map (cut make-string <> line) lengths))) + +(define (displayln a) + (display a) (newline)) + (define (summary-filter _ str) str) (define (main-loop regular-events repeating-events) @@ -64,11 +71,7 @@ (cls) (display-calendar-header! (time-utc->date time)) ;; (line) - (format #t "~a┬~a┬~a~%" - (make-string 20 #\─) - (make-string 32 #\─) - (make-string 10 #\─)) - + (displayln (box-top #\┬ #\─ 20 32 10)) (for-each (lambda (ev i) @@ -85,10 +88,7 @@ events (iota (length events))) - (format #t "~a┴~a┴~a~%" - (make-string 20 #\─) - (make-string 32 #\─) - (make-string 10 #\─)) + (displayln (box-top #\┴ #\─ 20 32 10)) (unless (null? events) (let ((ev (list-ref events cur-event))) |