[plt-scheme] DrScheme 3.99 bug on meta keypresses

From: Danny Yoo (dyoo at cs.wpi.edu)
Date: Wed Nov 21 14:56:32 EST 2007

Hi everyone,

I'm seeing the following error message on DrScheme 3.99:

car: expects argument of type <pair>; given {"File" . #<object:wx-menu%>}

  === context ===
on-subwindow-char method in frame%

It's triggered by pressing Alt-M.

The bug appears to be deep in MrEd rather than DrScheme.  It looks like 
collects/mred/private/mrmenu.ss sets a menu-item's data to a mutable 
pair... Ok, I think I found the bug.  There's a place in wxmenu that 
treats the result of get-menu-data as a pair, and that's what's causing 
the bug.

Here's the diff for the correction:

dyoo at kfisler-ra1:~/local/plt-svn-2$ svn diff collects/mred/
Index: collects/mred/private/wxmenu.ss
--- collects/mred/private/wxmenu.ss     (revision 7790)
+++ collects/mred/private/wxmenu.ss     (working copy)
@@ -64,8 +64,8 @@
                                             (lambda (i)
                                               (let* ([data (send (mred->wx 
i) get-menu-data)]
-                                                    [label (car data)]
-                                                    [menu (cdr data)])
+                                                    [label (mcar data)]
+                                                    [menu (mcdr data)])
                                                 (if (regexp-match re 
                                                       (send menu select 

I hope this helps!

Posted on the users mailing list.