aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2019-04-09 23:31:54 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2019-04-09 23:32:52 +0200
commitdfaf59f93b0ddd77bb3c499c65b3404187a8740e (patch)
treea03664f5f160d96859bf87e2421113753ad591c4
parentAdd mulit-set! (diff)
downloadcalp-dfaf59f93b0ddd77bb3c499c65b3404187a8740e.tar.gz
calp-dfaf59f93b0ddd77bb3c499c65b3404187a8740e.tar.xz
Add slightly better terminal drawing procedures.
-rwxr-xr-xmodule/main.scm18
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)))