From d4c91e2cbeaa22a0690475e54e367bc841945df6 Mon Sep 17 00:00:00 2001 From: Phil Hagelberg Date: Mon, 23 Mar 2020 08:34:17 -0700 Subject: [PATCH] Instructions. Ask for filename to save to. --- gui.rkt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gui.rkt b/gui.rkt index 99710fc..d3de877 100644 --- a/gui.rkt +++ b/gui.rkt @@ -72,7 +72,11 @@ (send canvas set-font (if special? small-font font)) (send canvas draw-text key (+ (first xy) (if special? 2 4)) - (+ (second xy) (if special? 2 0))))))) + (+ (second xy) (if special? 2 0)))))) + (send canvas set-font small-font) + (send canvas draw-text "Select a key with the arrows." 10 100) + (send canvas draw-text "Set its keycode with space." 10 108) + (send canvas draw-text "Press enter to write the layout to disk." 10 116)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Output @@ -153,7 +157,9 @@ [(escape) (set-state-mode! st 'quit)] [(#\space) (set-state-mode! st 'set)] [(#\tab) (printf "~s~n" st) st] - [(#\return) (write-layout "out.scm" (state-layers st))] + [(#\return) (let ([filename (put-file "Save to:")]) + (when filename + (write-layout filename (state-layers st))))] [(release) #f] [else (printf "~s~n" keycode) st]))