Ingo Maier | 5 Jul 22:20
Picon
Picon
Favicon

Re: Re: How to catch WindowClosing event in MainFrame ?

This has already been fixed in trunk.

Ingo

Johannes Rudolph wrote:
> Looking at the source code, I would guess the problem is, that
> MainFrame itself registers a reaction to listen for WindowClosing
> which calls System.exit. After this reaction would be called your
> reaction would be called -- if the process had not already exited by
> then...
> 
> See http://lampsvn.epfl.ch/trac/scala/browser/scala/tags/R_2_7_5_final/src/swing/scala/swing/MainFrame.scala
> 
> On Sun, Jul 5, 2009 at 3:06 PM, qwerky<ukpyr666 <at> gmail.com> wrote:
>> Not working :
>>
>>    override def top = new MainFrame {
>>        val mainFrame = this
>>        .................................................................
>>        listenTo( genStartButton, mainFrame )
>>        reactions += {
>>            case WindowClosing(`mainFrame`) =>
>>                println("Closing")
>>        }
>>        peer.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE)
>>    }
>>
>>
>> WindowActivated, WindowDeactivated, WindowDeiconified working.
>>
>> --
>> View this message in context: http://www.nabble.com/How-to-catch-WindowClosing-event-in-MainFrame---tp24342133p24342950.html
>> Sent from the Scala mailing list archive at Nabble.com.
>>
>>
> 
> 
> 


Gmane