// global data
//-----------------------------------------------------------------------------
-extern int g_openDialogs;
+// Don't allow window closing if there are open dialogs
+int g_openDialogs;
//-----------------------------------------------------------------------------
// wxDialog
much ugly flicker nor from within the size_allocate
handler, because GTK 1.1.X forbids that. */
- GtkOnSize( m_x, m_y, m_width, m_height );
+ GtkOnSize();
}
bool ret = wxWindow::Show( show );
// forbidden
if ( !GetParent() && !(GetWindowStyleFlag() & wxDIALOG_NO_PARENT) )
{
- wxWindow *parent = wxTheApp->GetTopWindow();
- if ( parent &&
- parent != this &&
- parent->IsBeingDeleted() &&
- !(parent->GetExtraStyle() & wxWS_EX_TRANSIENT) )
+ wxWindow * const parent = GetParentForModalDialog();
+ if ( parent && parent != this )
{
- m_parent = parent;
- gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_WINDOW(parent->m_widget) );
+ gtk_window_set_transient_for( GTK_WINDOW(m_widget),
+ GTK_WINDOW(parent->m_widget) );
}
}
// NOTE: gtk_window_set_modal internally calls gtk_grab_add() !
gtk_window_set_modal(GTK_WINDOW(m_widget), TRUE);
- wxEventLoop().Run();
+ wxGUIEventLoop().Run();
gtk_window_set_modal(GTK_WINDOW(m_widget), FALSE);