diff --git a/wxPython/src/_extras.py b/wxPython/src/_extras.py index 0e72a395d9..b2fb86c8bd 100644 --- a/wxPython/src/_extras.py +++ b/wxPython/src/_extras.py @@ -765,10 +765,14 @@ class wxApp(wxPyApp): error = 'wxApp.error' outputWindowClass = wxPyOnDemandOutputWindow - def __init__(self, redirect=_defRedirect, filename=None): + def __init__(self, redirect=_defRedirect, filename=None, useBestVisual=true): wxPyApp.__init__(self) self.stdioWin = None self.saveStdio = (sys.stdout, sys.stderr) + + # This has to be done before OnInit + self.SetUseBestVisual(useBestVisual) + if redirect: self.RedirectStdio(filename) # this initializes wxWindows and then calls our OnInit diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index a88ea2ae68..74b75a67bf 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -92,7 +92,6 @@ BOOL WINAPI DllMain( wxPyApp::wxPyApp() { - SetUseBestVisual(TRUE); } wxPyApp::~wxPyApp() {