I also tested the code on Mac OS X and Linux (Ubuntu AMD64) and got the same result.<br><br><div class="gmail_quote">On Sun, Jan 18, 2009 at 1:22 PM, Doug Williams <span dir="ltr"><<a href="mailto:m.douglas.williams@gmail.com">m.douglas.williams@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">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><font color="#888888">Doug<br><br>
</font></blockquote></div><br>