cocoa: fix "&" handling in menu-item labels

Closes PR 12025
This commit is contained in:
Matthew Flatt 2011-07-06 09:32:10 -06:00
parent d8352d5890
commit de54efc84e
2 changed files with 7 additions and 2 deletions

View File

@ -61,7 +61,7 @@
(send submenu install menu label enabled?)
(let ([item (as-objc-allocation
(tell (tell MyMenuItem alloc)
initWithTitle: #:type _NSString (regexp-replace #rx"\t.*" label "")
initWithTitle: #:type _NSString (clean-menu-label (regexp-replace #rx"\t.*" label ""))
action: #:type _SEL #f
keyEquivalent: #:type _NSString ""))])
(set-ivar! item wxb (->wxb this))

View File

@ -266,6 +266,10 @@
"[on-demand hook]"
m
void)
(make-object menu-item%
"6 && Half-D&ozen"
m
void)
(let mloop ([m m][sub-at-50? #t])
(let ([sm (if (and sub-at-50?
(send e button-down? 'middle))
@ -750,7 +754,8 @@
tab grp)]
[canvas (make-object popup-test-canvas%
items
(list "h slider" "v slider"
(list "combo"
"h slider" "v slider"
"v gauge" "v gauge"
; "text msg" "image msg"
"text"