Make sure that all loaded xrc dialogs have the correct parent. This might be overkill, but shouldn't hurt.

This commit is contained in:
wowzaman12 2015-03-28 13:54:49 +00:00
parent 2d5c702a7f
commit b07e5c63bf
1 changed files with 7 additions and 0 deletions

View File

@ -1972,6 +1972,13 @@ wxDialog * MainFrame::LoadXRCDialog(const char * name)
wxString dname = wxString::FromUTF8(name);
wxDialog * dialog = wxXmlResource::Get()->LoadDialog(this, dname);
CheckThrowXRCError(dialog,name);
/* wx-2.9.1 doesn't set parent for propertysheetdialogs for some reason */
/* this will generate a gtk warning but it is necessary for later */
/* retrieval using FindWindow() */
if(!dialog->GetParent())
dialog->Reparent(this);
mark_recursive(dialog);
return dialog;
}