[plt-scheme] How does a GUI application terminate?

From: Carl Eastlund (cce at ccs.neu.edu)
Date: Tue Aug 26 17:38:32 EDT 2008

On Tue, Aug 26, 2008 at 5:29 PM, Woodhouse Gregory
<gregory.woodhouse at gmail.com> wrote:
> I'm trying to get my feet wet with GUI applications, and one thing that's
> not clear to me is how to ask an application to close. Right now, I have
> code that looks like this for the "Close" menu item
> (define mi-quit (new menu-item% [label "Quit"]
>                                  [callback
>                                  (lambda (item evt)
>                                    (printf "Invoking ~s menu...~n" (send
> item get-label))
>                                    (send f show #f))]
>                                  [parent m-file]))
> but then it seems that I ought to signal that event processing should stop.
> My first thought was something like (send f close), but there is no close
> method in frame%.

I'm fairly certain the GUI knows that when a window closes, it can no
longer receive events.  Your code looks reasonable to me.

-- 
Carl Eastlund


Posted on the users mailing list.