[plt-scheme] OS-dependent behavior of canvas%'s on-subwindow-char method (v3.99)

From: Gregory Cooper (greg at cs.brown.edu)
Date: Mon Apr 7 09:09:48 EDT 2008

Sure.  If I run the following (in Pretty Big) on my Mac, click in the
window, and start typing, the REPL prints a bunch of "got subwindow
char" messages.  In Windows XP, nothing happens.

Interestingly, if I instead override on-subwindow-char in the frame,
then I do get the events in Windows, and I get each event twice on the
Mac (just from the frame).

(define f (new frame% [label "foo"] [width 300] [height 200]))
(send f show #t)
(define c (new (class canvas%
                 (super-new)
                 (define/override (on-subwindow-char . args)
                   (printf "got subwindow char~n")))
               [parent f]))

On Mon, Apr 7, 2008 at 8:56 AM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
>
> At Sat, 5 Apr 2008 13:18:10 -0400, "Gregory Cooper" wrote:
>  > In v3.99 under MacOS and Linux, I can override the on-subwindow-char
>  > method in a canvas% to respond to key events.  However, if I do the
>  > same in Windows XP, my callback doesn't get called.  Is this
>  > intentional?
>
>  No, it should work. Do you have a program to show the difference?
>
>  Thanks,
>  Matthew
>
>


Posted on the users mailing list.