[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

closing an application



I tried to close a window with the following code :
 
(invoke-unit/sig
 (unit/sig ()
   (import mred^)
  
   (define f (make-object (class frame% (title w h x y)
                            (override [on-close exit])
                            (sequence (super-init title #f w h x y)))
               "My first program" 300 200 350 150))
   
   (define m (make-object message% "This is a message" f))
  
   (make-object button% "Close me" f (lambda (b e) (send f show #f)))
  
   (send f show #t)
  
   (yield (make-semaphore 0)))
  
   mred^ )
 
The application hould close when clicking on the "close me" button.
 
The problem is that the window is hidden, but the application does not stop.
I tried also to send a 'close' message (send f close)
but this message is not understood.
 
Any suggestion ?
 
Maurizio Ferreira