X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b63b07a809f9a3d22596d4971ef5c8971153823a..785f5eaa05195f5e44a974861864324667a3326e:/src/gtk1/msgdlg.cpp diff --git a/src/gtk1/msgdlg.cpp b/src/gtk1/msgdlg.cpp index 2dd5336e65..610b4ec11a 100644 --- a/src/gtk1/msgdlg.cpp +++ b/src/gtk1/msgdlg.cpp @@ -39,7 +39,7 @@ wxMessageDialog::wxMessageDialog(wxWindow *parent, m_caption = caption; m_message = message; m_dialogStyle = style; - m_parent = parent; + m_parent = wxGetTopLevelParent(parent); } int wxMessageDialog::ShowModal() @@ -70,7 +70,10 @@ int wxMessageDialog::ShowModal() else if (m_dialogStyle & wxICON_QUESTION) type = GTK_MESSAGE_QUESTION; else - wxFAIL_MSG( _T("Unknown wxMessageDialog type") ); + { + // GTK+ doesn't have a "typeless" msg box, so try to auto detect... + type = m_dialogStyle & wxYES ? GTK_MESSAGE_QUESTION : GTK_MESSAGE_INFO; + } dlg = gtk_message_dialog_new(m_parent ? GTK_WINDOW(m_parent->m_widget) : NULL,