<div dir="ltr"><div>You probably want to augment `on-close' in `frame%', for example:<br>#lang racket/gui<br><br>(send <br> (new (class frame% (super-new)<br> (define/augment (on-close)<br> (displayln "Exiting...")))<br>
[label "Frame"] <br> [width 400] [height 200])<br> show #t)<br><br></div>which on my machine prints "Exiting..." when I click to closing cross.<br><br>Laurent<br></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Sun, Sep 8, 2013 at 4:07 AM, Eric Dong <span dir="ltr"><<a href="mailto:ericcesium133@gmail.com" target="_blank">ericcesium133@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi there,<div><br></div><div>My Racket GUI application needs to do a lot of cleanup work when exiting, i.e. when the user presses the X button. Wrapping the .rkt in a shell script which waits and then does the cleanup is a bit too hacky for me. There are many exit handlers in the Racket documentation (exit-handler etc) but none of them seem to work!</div>
<div><br></div><div>Thanks a whole ton!</div><div><br></div><div>Yuhao Dong</div></div>
<br>____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br></blockquote></div><br></div>