From 716aacf388dadf3d557eff0073dec582664a48b6 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Tue, 8 Jun 2010 16:43:32 -0500 Subject: [PATCH] changed the framework's standard menus frame so that the quit menu is never created under mac os x (which is the right behavior to make quit actually work properly). --- collects/framework/private/gen-standard-menus.rkt | 10 +++++----- collects/framework/private/standard-menus-items.rkt | 2 +- collects/framework/private/standard-menus.rkt | 4 +--- collects/scribblings/framework/standard-menus.scrbl | 4 ++-- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/collects/framework/private/gen-standard-menus.rkt b/collects/framework/private/gen-standard-menus.rkt index 5082f28b0f..120799bb53 100644 --- a/collects/framework/private/gen-standard-menus.rkt +++ b/collects/framework/private/gen-standard-menus.rkt @@ -7,7 +7,7 @@ (define-runtime-path here ".") -(define standard-menus.ss-filename (simplify-path (build-path here "standard-menus.ss"))) +(define standard-menus.rkt-filename (simplify-path (build-path here "standard-menus.rkt"))) (define docs-menus.ss-filename (simplify-path (build-path here 'up 'up "scribblings" "framework" "standard-menus.scrbl"))) ;; build-before-super-item-clause : an-item -> (listof clause) @@ -121,7 +121,7 @@ ,(generic-initializer generic)))])) (define (main) - (write-standard-menus.ss) + (write-standard-menus.rkt) (write-docs)) (define (write-docs) @@ -202,10 +202,10 @@ (display docs-footer-text port)) #:exists 'truncate)) -(define (write-standard-menus.ss) - (printf "writing to ~a~n" standard-menus.ss-filename) +(define (write-standard-menus.rkt) + (printf "writing to ~a~n" standard-menus.rkt-filename) - (call-with-output-file standard-menus.ss-filename + (call-with-output-file standard-menus.rkt-filename (λ (port) (pretty-print `(define standard-menus<%> diff --git a/collects/framework/private/standard-menus-items.rkt b/collects/framework/private/standard-menus-items.rkt index 05ae052766..10b4bf55be 100644 --- a/collects/framework/private/standard-menus-items.rkt +++ b/collects/framework/private/standard-menus-items.rkt @@ -280,7 +280,7 @@ (string-constant quit-menu-item-windows) (string-constant quit-menu-item-others)) on-demand-do-nothing - '(not (current-eventspace-has-standard-menus?))) + '(not (eq? (system-type) 'macosx))) (make-after 'file-menu 'quit 'nothing) (make-an-item 'edit-menu 'undo diff --git a/collects/framework/private/standard-menus.rkt b/collects/framework/private/standard-menus.rkt index a0999f6725..edbcbab91b 100644 --- a/collects/framework/private/standard-menus.rkt +++ b/collects/framework/private/standard-menus.rkt @@ -288,9 +288,7 @@ (string-constant quit-menu-item-others))) (define/public (file-menu:quit-help-string) (string-constant quit-info)) (define/public file-menu:quit-on-demand (λ (menu-item) (void))) - (define/public - (file-menu:create-quit?) - (not (current-eventspace-has-standard-menus?))) + (define/public (file-menu:create-quit?) (not (eq? (system-type) 'macosx))) (define/public file-menu:after-quit (λ (menu) (void))) (define/public edit-menu:undo-callback diff --git a/collects/scribblings/framework/standard-menus.scrbl b/collects/scribblings/framework/standard-menus.scrbl index ae1cce4e20..a99706eef3 100644 --- a/collects/scribblings/framework/standard-menus.scrbl +++ b/collects/scribblings/framework/standard-menus.scrbl @@ -125,7 +125,7 @@ @(defmethod (file-menu:get-quit-item) (or/c false/c (is-a?/c menu-item%)) "This method returns the " (scheme menu-item%) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> file-menu:create-quit?) ").") -@(defmethod (file-menu:create-quit?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme (not (current-eventspace-has-standard-menus?))) ".") +@(defmethod (file-menu:create-quit?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme (not (eq? (system-type) (quote macosx)))) ".") @(defmethod (file-menu:quit-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (when (exit:user-oks-exit) (exit:exit))) " ") @@ -349,4 +349,4 @@ @(defmethod (help-menu:after-about (menu (is-a?/c menu-item%))) void? "This method is called " "after" " the addition of the" "\n" (tt "about") " menu-item. Override it to add additional" "\n" "menu items at that point. ") -} +} \ No newline at end of file