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).
This commit is contained in:
Robby Findler 2010-06-08 16:43:32 -05:00
parent c8732f12e4
commit 716aacf388
4 changed files with 9 additions and 11 deletions

View File

@ -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<%>

View File

@ -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

View File

@ -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

View File

@ -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. ")
}
}