[racket] gui application needs to perform operation upon closing of a window

From: Stephen Chang (stchang at ccs.neu.edu)
Date: Wed May 22 19:14:43 EDT 2013

I was about to reply with the same answer as Matthias, but with
define/override instead of define/augment, but I kept getting an
error. Does it say anywhere in the docs whether a method is declared
using pubment or public? I couldnt find it.

On Wed, May 22, 2013 at 7:06 PM, Matthias Felleisen
<matthias at ccs.neu.edu> wrote:
>
> Here we go:
>
> #lang racket/gui
>
> (define my-frame%
>   (class frame%
>     (super-new)
>     (define/augment (on-close)
>       (displayln "closing now"))))
>
> (define frame
>   (new my-frame% [label "on closing"][width 300][height 200]))
>
> (send frame show #t)
>
>
>
> On May 22, 2013, at 6:55 PM, Zelah Hutchinson wrote:
>
>> From the documentation I gather that I need to augment the on-close method. I do not understand how to do this. Can someone show me a tiny example of how to perform an operation when a window is closed? Thank you.
>>
>> ____________________________________________________________
>> FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks & orcas on your desktop!
>> Check it out at http://www.inbox.com/marineaquarium
>>
>>
>>
>> ____________________
>>  Racket Users list:
>>  http://lists.racket-lang.org/users
>
>
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users

Posted on the users mailing list.