How to handle the graphical interface in Racket?

My Racket GUI application should do a lot of cleaning work on exit, i.e. when the user clicks the X button. These include the killing of child processes (which are not automatic in Windows), etc.

A .rkt wrapper in a shell script that is waiting and then cleaning up is too negligent for me. There are many exit handlers in the Racket documentation (exit handler, etc.), but none of them work!

+7
events racket
source share
1 answer

You probably want to increase on-close in frame% , for example:

 #lang racket/gui (send (new (class frame% (super-new) (define/augment (on-close) (displayln "Exiting..."))) [label "Frame"] [width 400] [height 200]) show #t) 

which prints "Exit ..." on my machine when I click on the closing cross.

+9
source share

All Articles