From a374801465246cb3e98cb7fcbd259296988b16fe Mon Sep 17 00:00:00 2001 From: Micha Ahrweiler Date: Thu, 7 Apr 2016 11:03:45 +0200 Subject: [PATCH] Make OK button default in wxGTK wxMessageDialog by default Under wxGTK the default button in wxMessageDialog with style wxOK was set to "Cancel", whether the wxOK_DEFAULT style was specified or not. Now it is set to "OK", as expected, and wxCANCEL_DEFAULT needs to be explicitly specified to focus the "Cancel" one. Closes https://github.com/wxWidgets/wxWidgets/pull/267 --- src/gtk/msgdlg.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gtk/msgdlg.cpp b/src/gtk/msgdlg.cpp index e9de535947..d784ede638 100644 --- a/src/gtk/msgdlg.cpp +++ b/src/gtk/msgdlg.cpp @@ -214,6 +214,8 @@ void wxMessageDialog::GTKCreateMsgDialog() defaultButton = GTK_RESPONSE_NO; else if ( m_dialogStyle & wxYES_NO ) defaultButton = GTK_RESPONSE_YES; + else if ( m_dialogStyle & wxOK ) + defaultButton = GTK_RESPONSE_OK; else // No need to change the default value, whatever it is. defaultButton = GTK_RESPONSE_NONE;