adjust contract for test:button-push so it isn't so ugly
original commit: 977fd37913e04d9ae6f7127f037c428c6b86a630
This commit is contained in:
parent
c1dd757d5e
commit
5e895a0725
|
@ -852,25 +852,30 @@
|
|||
(define test:mouse-click mouse-click)
|
||||
(define test:new-window new-window)
|
||||
|
||||
(define (label-of-enabled/shown-button-in-top-level-window? str)
|
||||
(test:top-level-focus-window-has?
|
||||
(λ (c)
|
||||
(and (is-a? c button%)
|
||||
(string=? (send c get-label) str)
|
||||
(send c is-enabled?)
|
||||
(send c is-shown?)))))
|
||||
|
||||
(define (enabled-shown-button? btn)
|
||||
(and (send btn is-enabled?)
|
||||
(send btn is-shown?)))
|
||||
|
||||
(define (button-in-top-level-focusd-window? btn)
|
||||
(test:top-level-focus-window-has?
|
||||
(λ (c) (eq? c btn))))
|
||||
|
||||
(provide/doc
|
||||
(proc-doc/names
|
||||
test:button-push
|
||||
(-> (or/c (λ (str)
|
||||
(and (string? str)
|
||||
(test:top-level-focus-window-has?
|
||||
(λ (c)
|
||||
(and (is-a? c button%)
|
||||
(string=? (send c get-label) str)
|
||||
(send c is-enabled?)
|
||||
(send c is-shown?))))))
|
||||
|
||||
(-> (or/c (and/c string?
|
||||
label-of-enabled/shown-button-in-top-level-window?)
|
||||
(and/c (is-a?/c button%)
|
||||
(λ (btn)
|
||||
(and (send btn is-enabled?)
|
||||
(send btn is-shown?)))
|
||||
(λ (btn)
|
||||
(test:top-level-focus-window-has?
|
||||
(λ (c) (eq? c btn))))))
|
||||
enabled-shown-button?
|
||||
button-in-top-level-focusd-window?))
|
||||
void?)
|
||||
(button)
|
||||
@{Simulates pushing @racket[button]. If a string is supplied, the
|
||||
|
|
Loading…
Reference in New Issue
Block a user