X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/342b6a2fe480fa6f6ee80fdb51cb009c30b35305..a91b47e800c78dbf8e91191ce3977d148a13f1fe:/src/gtk/frame.cpp diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index af7887cf2c..c314c3d28c 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -8,7 +8,7 @@ ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ -#pragma implementation "frame.h" + #pragma implementation "frame.h" #endif #include "wx/frame.h" @@ -197,14 +197,14 @@ wxFrame::~wxFrame() if (m_frameToolBar) delete m_frameToolBar; wxTopLevelWindows.DeleteObject( this ); - + if (wxTheApp->GetTopWindow() == this) { wxTheApp->SetTopWindow( (wxWindow*) NULL ); } - + if (wxTopLevelWindows.Number() == 0) - { + { wxTheApp->ExitMainLoop(); } } @@ -226,11 +226,6 @@ bool wxFrame::Show( bool show ) return wxWindow::Show( show ); } -void wxFrame::OnCloseWindow( wxCloseEvent &event ) -{ - if (GetEventHandler()->OnClose() || event.GetForce()) this->Destroy(); -} - bool wxFrame::Destroy() { wxASSERT_MSG( (m_widget != NULL), "invalid frame" ); @@ -480,6 +475,13 @@ void wxFrame::OnInternalIdle() DoMenuUpdates(); } +void wxFrame::OnCloseWindow( wxCloseEvent& event ) +{ + // close the window if it wasn't vetoed by the application +// if ( !event.GetVeto() ) // No, this isn't the interpretation of GetVeto. + Destroy(); +} + void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) ) { wxASSERT_MSG( (m_widget != NULL), "invalid frame" );