make the 'failed to click on the radio box' error message more helpful

This commit is contained in:
Robby Findler 2012-11-11 20:12:50 -06:00
parent 9ad93eaa2d
commit 8c47dbba01

View File

@ -424,21 +424,26 @@
;; entry-matches : string | regexp -> radio-box -> boolean ;; entry-matches : string | regexp -> radio-box -> boolean
(define (entry-matches name) (define (entry-matches name)
(λ (rb) (procedure-rename
(let loop ([n (send rb get-number)]) (λ (rb)
(cond (let loop ([n (send rb get-number)])
[(zero? n) #f] (cond
[else [(zero? n) #f]
(let ([itm (send rb get-item-label (- n 1))] [else
[pln-itm (send rb get-item-plain-label (- n 1))]) (let ([itm (send rb get-item-label (- n 1))]
(or (cond [pln-itm (send rb get-item-plain-label (- n 1))])
[(string? name) (or (cond
(or (equal? name itm) [(string? name)
(equal? name pln-itm))] (or (equal? name itm)
[(regexp? name) (equal? name pln-itm))]
(or (regexp-match name itm) [(regexp? name)
(regexp-match name pln-itm))]) (or (regexp-match name itm)
(loop (- n 1))))])))) (regexp-match name pln-itm))])
(loop (- n 1))))])))
(string->symbol
(if (regexp? name)
(object-name name)
name))))
;;; CHOICE ;;; CHOICE