cocoa: fix relabel of image checkbox

This commit is contained in:
Matthew Flatt 2010-11-28 07:52:01 -07:00
parent 262531e231
commit f090e732fd

View File

@ -87,7 +87,8 @@
(NSSize-height (NSRect-size frame))))))) (NSSize-height (NSRect-size frame)))))))
cocoa)) cocoa))
(define cocoa (if (and button-type (define-values (cocoa image-cocoa)
(if (and button-type
(not (string? label)) (not (string? label))
(send label ok?)) (send label ok?))
;; Check-box image: need an view to join a button and an image view: ;; Check-box image: need an view to join a button and an image view:
@ -120,8 +121,8 @@
(make-NSRect (make-NSPoint 0 0) (make-NSRect (make-NSPoint 0 0)
(make-NSSize new-width new-height))) (make-NSSize new-width new-height)))
(set-ivar! button-cocoa wxb (->wxb this)) (set-ivar! button-cocoa wxb (->wxb this))
cocoa)) (values cocoa image-cocoa)))
button-cocoa)) (values button-cocoa #f)))
(define we (make-will-executor)) (define we (make-will-executor))
@ -146,7 +147,7 @@
[(string? label) [(string? label)
(tellv cocoa setTitleWithMnemonic: #:type _NSString label)] (tellv cocoa setTitleWithMnemonic: #:type _NSString label)]
[else [else
(tellv cocoa setImage: (bitmap->image label))])) (tellv (or image-cocoa cocoa) setImage: (bitmap->image label))]))
(define callback cb) (define callback cb)
(define/public (clicked) (define/public (clicked)