tighten contracts in a way that appears

consistent with their behavior and their
documentation
This commit is contained in:
Robby Findler 2013-12-27 17:41:23 -06:00
parent c12a6bea0e
commit b591729891
2 changed files with 7 additions and 4 deletions

View File

@ -15,8 +15,9 @@ A @racket[menu-item%] is a plain string-labelled menu item. Its
[help-string (or/c label-string? #f) #f]
[demand-callback ((is-a?/c menu-item%) . -> . any)
(lambda (i) (void))]
[shortcut-prefix (listof (or/c 'alt 'cmd 'meta 'ctl
'shift 'option))
[shortcut-prefix (and/c (listof (or/c 'alt 'cmd 'meta 'ctl
'shift 'option))
(λ (x) (equal? x (remove-duplicates x))))
(get-default-shortcut-prefix)])]{
Creates a new menu item in @racket[parent]. The item is initially

View File

@ -96,9 +96,11 @@ The result depends on @racket[what], and a @racket[#f] result is only
}
@defproc[(get-default-shortcut-prefix)
(listof (or/c 'alt 'cmd 'meta 'ctl 'shift 'option))]{
(case (system-type)
[(windows) (list/c 'ctl)]
[(macosx) (list/c 'cmd)]
[(unix) (list/c (or/c 'alt 'cmd 'meta 'ctl 'shift 'option))])]{
Returns an immutable list specifying the default prefix for menu
shortcuts. See also
@xmethod[selectable-menu-item<%> get-shortcut-prefix].