I am trying to use a shortcut for a checkable menu item and I don't understand the behavior. Consider the following trivial gui program.<br><br>#lang scheme/gui<br><br>(define the-frame<br> (instantiate frame%<br> ("Test")<br>
(min-width 100)<br> (min-height 100)))<br><br>(define the-menu-bar<br> (instantiate menu-bar%<br> (the-frame)))<br><br>(define the-test-menu<br> (instantiate menu%<br> ("&Test" the-menu-bar)))<br>
<br>(define the-checkable-menu-item<br> (instantiate checkable-menu-item%<br> ("&Check" the-test-menu)<br> (callback<br> (lambda (checkable-menu-item event)<br> (printf "is-checked? = ~a~n"<br>
(send checkable-menu-item is-checked?))))<br> (shortcut #\C)))<br><br>(send the-frame show #t)<br><br>If I select the check menu item with the mouse or with the alt keys (alt-T, alt-C in this case), it toggles and prints as expected. If I select it using the shortcut key (cntl-C in this case), the callback runs but the value isn't toggled. Is this the 'correct' behavior? [If so, I assume I need to check the event type and toggle the check myself.]<br>
<br>I'm running Version 4.1.3.900 (4.1.4 prerelease candidate) on Windows XP.<br><br>Thanks,<br>Doug<br><br>