X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/150c8eb9190be56e8d9f6c286324dda409d483d4..74a3342702bf3a76a845f65f4510fd8612d3d802:/src/gtk/msgdlg.cpp?ds=sidebyside diff --git a/src/gtk/msgdlg.cpp b/src/gtk/msgdlg.cpp index 428b1e2720..d7b27a4777 100644 --- a/src/gtk/msgdlg.cpp +++ b/src/gtk/msgdlg.cpp @@ -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()