]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/msgdlg.cpp
wxUSE_TOOLTIPS and wxUSE_IMAGE furthur fixes
[wxWidgets.git] / src / gtk1 / msgdlg.cpp
index 250c8798815107889fe90de3b8b66e3fd722e6ff..4e3eb6d2fffec35581036cd5d0a8a957e801a30d 100644 (file)
 
 #if wxUSE_MSGDLG && defined(__WXGTK20__) && !defined(__WXGPE__)
 
+#include "wx/msgdlg.h"
 #include "wx/gtk/private.h"
 #include <gtk/gtk.h>
 
-#include "wx/msgdlg.h"
 #include "wx/intl.h"
 
 IMPLEMENT_CLASS(wxMessageDialog, wxDialog)
@@ -90,13 +90,22 @@ wxMessageDialog::wxMessageDialog(wxWindow *parent,
             gtk_dialog_set_default_response(GTK_DIALOG(m_widget), GTK_RESPONSE_YES);
     }
 
-    if (parent)
+    if (m_parent)
         gtk_window_set_transient_for(GTK_WINDOW(m_widget),
                                      GTK_WINDOW(m_parent->m_widget));
 }
  
+wxMessageDialog::~wxMessageDialog()
+{
+}
+
 int wxMessageDialog::ShowModal()
 {
+    // This should be necessary, but otherwise the
+    // parent TLW will disappear..
+    if (m_parent)
+        gtk_window_present( GTK_WINDOW(m_parent->m_widget) );
+        
     gint result = gtk_dialog_run(GTK_DIALOG(m_widget));
     gtk_widget_destroy(m_widget);
     m_widget = NULL;
@@ -108,6 +117,8 @@ int wxMessageDialog::ShowModal()
             // fall through
 
         case GTK_RESPONSE_CANCEL:
+        case GTK_RESPONSE_DELETE_EVENT:
+        case GTK_RESPONSE_CLOSE:
             return wxID_CANCEL;
         case GTK_RESPONSE_OK:
             return wxID_OK;