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">&lt;<a href="mailto:m.douglas.williams@gmail.com">m.douglas.williams@gmail.com</a>&gt;</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&#39;t understand the behavior. Consider the following trivial gui program.<br>
<br>#lang scheme/gui<br><br>(define the-frame<br>&nbsp; (instantiate frame%<br>&nbsp;&nbsp;&nbsp; (&quot;Test&quot;)<br>
&nbsp;&nbsp;&nbsp; (min-width 100)<br>&nbsp;&nbsp;&nbsp; (min-height 100)))<br><br>(define the-menu-bar<br>&nbsp; (instantiate menu-bar%<br>&nbsp;&nbsp;&nbsp; (the-frame)))<br><br>(define the-test-menu<br>&nbsp; (instantiate menu%<br>&nbsp;&nbsp;&nbsp; (&quot;&amp;Test&quot; the-menu-bar)))<br>

<br>(define the-checkable-menu-item<br>&nbsp; (instantiate checkable-menu-item%<br>&nbsp;&nbsp;&nbsp; (&quot;&amp;Check&quot; the-test-menu)<br>&nbsp;&nbsp;&nbsp; (callback<br>&nbsp;&nbsp;&nbsp;&nbsp; (lambda (checkable-menu-item event)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (printf &quot;is-checked? = ~a~n&quot;<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (send checkable-menu-item is-checked?))))<br>&nbsp;&nbsp;&nbsp; (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&#39;t toggled. Is this the &#39;correct&#39; behavior? [If so, I assume I need to check the event type and toggle the check myself.]<br>

<br>I&#39;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>