]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/msgdlg.cpp
fix the definition of many static functions marked as 'const' or functions which...
[wxWidgets.git] / src / gtk / msgdlg.cpp
index 428b1e27204cc9f90e75cf3f3c7c5104d5351e2c..d7b27a4777e399efd0bfe7fccce45b67964f925b 100644 (file)
@@ -208,10 +208,16 @@ void wxMessageDialog::GTKCreateMsgDialog()
             }
         }
 
-        gtk_dialog_set_default_response(dlg,
-                                        m_dialogStyle & wxNO_DEFAULT
-                                            ? GTK_RESPONSE_NO
-                                            : GTK_RESPONSE_YES);
+        // it'd probably be harmless to call gtk_dialog_set_default_response()
+        // twice but why do it if we're going to change the default below
+        // anyhow
+        if ( !(m_dialogStyle & wxCANCEL_DEFAULT) )
+        {
+            gtk_dialog_set_default_response(dlg,
+                                            m_dialogStyle & wxNO_DEFAULT
+                                                ? GTK_RESPONSE_NO
+                                                : GTK_RESPONSE_YES);
+        }
     }
     else if ( addButtons ) // Ok or Ok/Cancel dialog
     {
@@ -222,6 +228,11 @@ void wxMessageDialog::GTKCreateMsgDialog()
                                   GTK_RESPONSE_CANCEL);
         }
     }
+
+    if ( m_dialogStyle & wxCANCEL_DEFAULT )
+    {
+        gtk_dialog_set_default_response(dlg, GTK_RESPONSE_CANCEL);
+    }
 }
 
 int wxMessageDialog::ShowModal()