racket/gui/base: fix menu-bar%' get-frame' to return 'root

Return 'root istead of exposing the (hidden) root frame for
a menu bar that is shown when no frames are visible.

original commit: d0cfc34a77c23c8b5fd61b341dc6c446c3deae96
This commit is contained in:
Matthew Flatt 2013-02-04 19:28:37 -07:00
parent d580a45928
commit 014fbe20b3
2 changed files with 4 additions and 3 deletions

View File

@ -441,7 +441,7 @@
(define wx-parent #f)
(define shown? #f)
(public*
[get-frame (lambda () prnt)]
[get-frame (lambda () (if (eq? root-menu-frame prnt) 'root prnt))]
[get-items (entry-point (lambda () (send wx get-items)))]
[enable (entry-point (lambda (on?) (send wx enable-all on?)))]
[is-enabled? (entry-point (lambda () (send wx all-enabled?)))]

View File

@ -41,9 +41,10 @@ Enables or disables the menu bar (i.e., all of its menus). Each
@defmethod[(get-frame)
(is-a?/c frame%)]{
(or/c (is-a?/c frame%) 'root)]{
Returns the menu bar's frame.
Returns the menu bar's frame, or returns @racket['root] if the menu
bar is shown when no other frames are shown.
}