From 5854cf6ec57b5821cacb6294f9330b759cbafd64 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Mon, 19 May 1997 16:54:32 +0000 Subject: [PATCH] re-arranged exit callbacks to fix bugs original commit: 698d9f5722deb10dcff6299cbc8c9e8e63eb0ae3 --- collects/mred/exit.ss | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/collects/mred/exit.ss b/collects/mred/exit.ss index 0068000d..32c9a916 100644 --- a/collects/mred/exit.ss +++ b/collects/mred/exit.ss @@ -34,28 +34,27 @@ [else (loop (cdr cb-list))]))))) (define -exit - (let ([exiting? #f]) + (let*-values ([(exiting?) #f] + [(w capW) + (if (eq? wx:platform 'macintosh) + (values "quit" "Quit") + (values "exit" "Exit"))] + [(message) + (string-append "Are you sure you want to " + w + "?")]) (lambda () (unless exiting? (dynamic-wind (lambda () (set! exiting? #t)) (lambda () (let/ec k - (when (and (mred:preferences:get-preference 'mred:verify-exit) - (not (let ([w (if (eq? wx:platform 'macintosh) - "quit" - "exit")] - [capW (if (eq? wx:platform 'macintosh) - "Quit" - "Exit")]) - (mred:gui-utils:get-choice - (string-append "Are you sure you want to " w "?") - capW "Cancel")))) - (k #f)) + (when (mred:preferences:get-preference 'mred:verify-exit) + (unless (mred:gui-utils:get-choice + message capW "Cancel") + (k #f))) (run-exit-callbacks) (if (null? exit-callbacks) (exit) #f))) - (lambda () (set! exiting? #f)))))))) - - + (lambda () (set! exiting? #f)))))))) \ No newline at end of file