Allow the developer to choose if SetUseBestVisual is called

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17257 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2002-09-18 20:39:08 +00:00
parent 1176111c0d
commit 5fb99fe76f
2 changed files with 5 additions and 2 deletions

View File

@@ -765,10 +765,14 @@ class wxApp(wxPyApp):
error = 'wxApp.error' error = 'wxApp.error'
outputWindowClass = wxPyOnDemandOutputWindow outputWindowClass = wxPyOnDemandOutputWindow
def __init__(self, redirect=_defRedirect, filename=None): def __init__(self, redirect=_defRedirect, filename=None, useBestVisual=true):
wxPyApp.__init__(self) wxPyApp.__init__(self)
self.stdioWin = None self.stdioWin = None
self.saveStdio = (sys.stdout, sys.stderr) self.saveStdio = (sys.stdout, sys.stderr)
# This has to be done before OnInit
self.SetUseBestVisual(useBestVisual)
if redirect: if redirect:
self.RedirectStdio(filename) self.RedirectStdio(filename)
# this initializes wxWindows and then calls our OnInit # this initializes wxWindows and then calls our OnInit

View File

@@ -92,7 +92,6 @@ BOOL WINAPI DllMain(
wxPyApp::wxPyApp() { wxPyApp::wxPyApp() {
SetUseBestVisual(TRUE);
} }
wxPyApp::~wxPyApp() { wxPyApp::~wxPyApp() {