[racket] GUI buttons with & in label

From: Harry Spier (vasishtha.spier at gmail.com)
Date: Mon Jan 27 20:46:35 EST 2014

I'm using Racket 5.3.6 with windows and ran the following GUI program
#lang racket/gui
(define frame (new frame% [label "Example"]))
(define msg (new message% [parent frame][label "No events so far..."]))
(new button% [parent frame]
     [label "&Click Me"]
     ; Callback procedure for a button click:
     [callback (lambda (button event)
                       (send msg set-label "Button click"))])
(send frame show #t)


The documentation http://docs.racket-lang.org/gui/button_.html
says:
------------------------
If & occurs in label (when label includes a string), it is specially
parsed; on Windows and Unix, the character following & is underlined in the
displayed control to indicate a keyboard mnemonic. (On Mac OS X, mnemonic
underlines are not shown.) The underlined mnemonic character must be a
letter or a digit. The user can effectively click the button by typing the
mnemonic when the control’s top-level-window contains the keyboard focus.
----------------------------
but for the above program "C" in the button label isn't underlined and
typing "C" doesn't appear to be working as a keyboard mnemonic.

I'm I doing something wrong or is this a bug?

Thanks,
Harry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140127/f91fc822/attachment-0001.html>

Posted on the users mailing list.