;; This is a gui tool for editing the Hourglass site configuration (load "runtk.lsp") (define (pad TXT (N 0)) (string TXT (dup " " (max (- N (length TXT)) 0)))) (define (wrap TXT (WIDTH 60)) (let ((OUT '()) (LN "") (FST 0)) (dolist (W (parse (replace "\n" TXT " ") " ")) (when (> (+ (length LN) (length W) FST) WIDTH) (push (pad LN) OUT -1) (setf LN "") (setf FST 0)) (extend LN (if (= FST) "" " ") W) (setf FST 1)) (unless (empty? LN) (push (pad LN) OUT -1)) (join OUT "\n"))) ; Register all tooltips (dolist (SETTING (parse (read-file "tooltips.txt") "---\n")) (let ((TAG (when (regex "(\\S+)" SETTING 0) $1))) (tk (format "set desc(%s) {%s}" TAG (replace "\n" SETTING " "))))) (tk:load-tcl "sitetool.tcl") (when nil (while true (tk:read-loop) (println (eval-string (or (read-line) (exit)))) ))