X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d182ca1ba6d87dadb3b103bd8039501ba36d9ebe..949ff63e2f81719cd47a6c6b26047ee57c0aa052:/src/gtk/msgdlg.cpp diff --git a/src/gtk/msgdlg.cpp b/src/gtk/msgdlg.cpp index a0861aaf37..ddbecfa54a 100644 --- a/src/gtk/msgdlg.cpp +++ b/src/gtk/msgdlg.cpp @@ -38,17 +38,18 @@ wxMessageDialog::wxMessageDialog(wxWindow *parent, m_caption = caption; m_message = message; SetMessageDialogStyle(style); - m_parent = wxGetTopLevelParent(parent); + + m_parent = GetParentForModalDialog(parent); GtkMessageType type = GTK_MESSAGE_ERROR; GtkButtonsType buttons = GTK_BUTTONS_OK; if (style & wxYES_NO) { - if (style & wxCANCEL) - buttons = GTK_BUTTONS_NONE; - else - buttons = GTK_BUTTONS_YES_NO; + if (style & wxCANCEL) + buttons = GTK_BUTTONS_NONE; + else + buttons = GTK_BUTTONS_YES_NO; } if (style & wxOK) @@ -84,14 +85,14 @@ wxMessageDialog::wxMessageDialog(wxWindow *parent, if (style & wxYES_NO) { if (style & wxCANCEL) - { + { gtk_dialog_add_button(GTK_DIALOG(m_widget), GTK_STOCK_NO, GTK_RESPONSE_NO); gtk_dialog_add_button(GTK_DIALOG(m_widget), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); gtk_dialog_add_button(GTK_DIALOG(m_widget), GTK_STOCK_YES, GTK_RESPONSE_YES); - } + } if (style & wxNO_DEFAULT) gtk_dialog_set_default_response(GTK_DIALOG(m_widget), GTK_RESPONSE_NO); else