X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9c605df7699688acbda6d2b08f2f191c906d9bc7..5a2e3d8c47db7f95d504ecd45f58b96c56572dd1:/wxPython/src/helpers.cpp diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index c05de89a4f..c08d287265 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -29,6 +29,7 @@ #include #include #define GetXWindow(wxwin) GDK_WINDOW_XWINDOW((wxwin)->m_widget->window) +#include #endif #ifdef __WXX11__ @@ -398,15 +399,28 @@ void wxPyApp::_BootstrapApp() } wxPyEndBlockThreads(blocked); + // Initialize wxWidgets result = wxEntryStart(argc, argv); delete [] argv; blocked = wxPyBeginBlockThreads(); if (! result) { - PyErr_SetString(PyExc_SystemError, "wxEntryStart failed!"); + PyErr_SetString(PyExc_SystemError, + "wxEntryStart failed, unable to initialize wxWidgets!" +#ifdef __WXGTK__ + " (Is DISPLAY set properly?)" +#endif + ); goto error; } + // On wxGTK the locale will be changed to match the system settings, but + // Python needs to have LC_NUMERIC set to "C" in order for the floating + // point conversions and such to work right. +#ifdef __WXGTK__ + setlocale(LC_NUMERIC, "C"); +#endif + // The stock objects were all NULL when they were loaded into // SWIG generated proxies, so re-init those now... wxPy_ReinitStockObjects(3); @@ -437,7 +451,6 @@ void wxPyApp::_BootstrapApp() result = True; } - if (! result) { PyErr_SetString(PyExc_SystemExit, "OnInit returned False, exiting..."); } @@ -523,6 +536,8 @@ void __wxPyPreStart(PyObject* moduleDict) // Init the stock objects to a non-NULL value so SWIG doesn't create them as None wxPy_ReinitStockObjects(1); + + wxInitAllImageHandlers(); } @@ -543,7 +558,7 @@ void __wxPyCleanup() { } -// Save a reference to the dictionary of the wx.core module, and inject +// Save a reference to the dictionary of the wx._core module, and inject // a few more things into it. PyObject* __wxPySetDictionary(PyObject* /* self */, PyObject* args) { @@ -561,7 +576,7 @@ PyObject* __wxPySetDictionary(PyObject* /* self */, PyObject* args) PyDict_SetItemString(wxPython_dict, "__wxPyPtrTypeMap", wxPyPtrTypeMap); // Create an exception object to use for wxASSERTions - wxPyAssertionError = PyErr_NewException("wx.core.PyAssertionError", + wxPyAssertionError = PyErr_NewException("wx._core.PyAssertionError", PyExc_AssertionError, NULL); PyDict_SetItemString(wxPython_dict, "PyAssertionError", wxPyAssertionError);