tighten contracts in a way that appears
consistent with their behavior and their documentation original commit: b59172989186bdce4d71069305adf19af8f530b9
This commit is contained in:
parent
6a8a6e2f51
commit
fd02a72886
|
@ -15,8 +15,9 @@ A @racket[menu-item%] is a plain string-labelled menu item. Its
|
||||||
[help-string (or/c label-string? #f) #f]
|
[help-string (or/c label-string? #f) #f]
|
||||||
[demand-callback ((is-a?/c menu-item%) . -> . any)
|
[demand-callback ((is-a?/c menu-item%) . -> . any)
|
||||||
(lambda (i) (void))]
|
(lambda (i) (void))]
|
||||||
[shortcut-prefix (listof (or/c 'alt 'cmd 'meta 'ctl
|
[shortcut-prefix (and/c (listof (or/c 'alt 'cmd 'meta 'ctl
|
||||||
'shift 'option))
|
'shift 'option))
|
||||||
|
(λ (x) (equal? x (remove-duplicates x))))
|
||||||
(get-default-shortcut-prefix)])]{
|
(get-default-shortcut-prefix)])]{
|
||||||
|
|
||||||
Creates a new menu item in @racket[parent]. The item is initially
|
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)
|
@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
|
Returns an immutable list specifying the default prefix for menu
|
||||||
shortcuts. See also
|
shortcuts. See also
|
||||||
@xmethod[selectable-menu-item<%> get-shortcut-prefix].
|
@xmethod[selectable-menu-item<%> get-shortcut-prefix].
|
||||||
|
|
Loading…
Reference in New Issue
Block a user