tighten contracts in a way that appears
consistent with their behavior and their documentation
This commit is contained in:
parent
c12a6bea0e
commit
b591729891
|
@ -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
|
||||
|
|
|
@ -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].
|
||||
|
|
Loading…
Reference in New Issue
Block a user