X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7aad0bf32e6b59c360fa3144a844cf0a62a1a429..3a5bcc4db0851bf8cd3063917511b0b17c7f9679:/src/gtk/msgdlg.cpp diff --git a/src/gtk/msgdlg.cpp b/src/gtk/msgdlg.cpp index 9f61be98d7..610b4ec11a 100644 --- a/src/gtk/msgdlg.cpp +++ b/src/gtk/msgdlg.cpp @@ -39,14 +39,7 @@ wxMessageDialog::wxMessageDialog(wxWindow *parent, m_caption = caption; m_message = message; m_dialogStyle = style; - - if (parent) - { - while (!parent->IsTopLevel()) - parent = parent->GetParent(); - } - - m_parent = parent; + m_parent = wxGetTopLevelParent(parent); } int wxMessageDialog::ShowModal() @@ -77,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,