X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/91af089567c5e13a408f1c529f6830d12cdc6c4e..137c8bde085d6d5b7c459902d2ea1a198ab48765:/src/gtk/dialog.cpp?ds=sidebyside diff --git a/src/gtk/dialog.cpp b/src/gtk/dialog.cpp index 115965adc4..e4caf1baae 100644 --- a/src/gtk/dialog.cpp +++ b/src/gtk/dialog.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: dialog.cpp +// Name: src/gtk/dialog.cpp // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -7,17 +7,18 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "dialog.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #include "wx/dialog.h" -#include "wx/frame.h" -#include "wx/app.h" -#include "wx/cursor.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" + #include "wx/frame.h" + #include "wx/cursor.h" +#endif // WX_PRECOMP + +#include "wx/evtloop.h" #include #include @@ -205,15 +206,16 @@ int wxDialog::ShowModal() Show( true ); - SetFocus(); - m_modalShowing = true; g_openDialogs++; - gtk_grab_add( m_widget ); - gtk_main(); - gtk_grab_remove( m_widget ); + // NOTE: gtk_window_set_modal internally calls gtk_grab_add() ! + gtk_window_set_modal(GTK_WINDOW(m_widget), TRUE); + + wxEventLoop().Run(); + + gtk_window_set_modal(GTK_WINDOW(m_widget), FALSE); g_openDialogs--;