racket/gui cocoa: fix swapping of buttons with the 'border style
Register a button as a default button every time that it is shown, so that multiple buttons in a frame can have the 'border style (as long as only one is shown at a time).
This commit is contained in:
parent
82457258e2
commit
a9cc79c89b
|
@ -150,8 +150,10 @@
|
|||
[no-show? (memq 'deleted style)]
|
||||
[callback cb])
|
||||
|
||||
(when (memq 'border style)
|
||||
(tellv (get-cocoa-window) setDefaultButtonCell: (tell button-cocoa cell)))
|
||||
(define default-button? (memq 'border style))
|
||||
(define/override (show-children)
|
||||
(when default-button?
|
||||
(tellv (get-cocoa-window) setDefaultButtonCell: (tell button-cocoa cell))))
|
||||
|
||||
(tellv button-cocoa setTarget: button-cocoa)
|
||||
(tellv button-cocoa setAction: #:type _SEL (selector clicked:))
|
||||
|
|
Loading…
Reference in New Issue
Block a user