Use this function to simulate clicking on the close box of a frame.
Closes frame with this expression:
(when (send frame can-close?) (send frame on-close) (send frame show #f))