wxGTK now uses gtk_init_check so wxPython can raise an exception if
there is no DISPLAY available or other initializaion problem. wx.GetKeyState now has an implementation for wxGTK and is able to detect the up/down or toggle state of modifier and toggle keys. The LC_NUMERIC locale is now reset back to "C" (compatibility) when running on wxGTK to work around the fact that GTK requires the locale to be set to the system settings but Python depends on LC_NUMERIC remaining compatible with "C". git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27376 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#include <gdk/gdkprivate.h>
|
||||
#include <wx/gtk/win_gtk.h>
|
||||
#define GetXWindow(wxwin) GDK_WINDOW_XWINDOW((wxwin)->m_widget->window)
|
||||
#include <locale.h>
|
||||
#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...");
|
||||
}
|
||||
|
Reference in New Issue
Block a user