AppleEvents can be handled by overriding wx.App methods MacOpenFile,
MacPrintFile, MacNewFile, and MacReopenApp.
+Added wx.PlatformInfo which is a tuple containing strings that
+describe the platform and build options of wxPython. See the
+MigrationGuide for more details.
+
wrappers will figure out what to do.
+PlatformInfo
+------------
+
+Added wx.PlatformInfo which is a tuple containing strings that
+describe the platform and build options of wxPython. This lets you
+know more about the build than just the __WXPORT__ value that
+wx.Platform contains, such as if it is a GTK2 build. For example,
+instead of::
+
+ if wx.Platform == "__WXGTK__":
+ ...
+
+you should do this::
+
+ if "__WXGTK__" in wx.PlatformInfo:
+ ...
+
+and you can specifically check for a wxGTK2 build by looking for
+"gtk2" in wx.PlatformInfo. Unicode builds are also detectable this
+way. If there are any other platform/toolkit/build flags that make
+sense to add to this tuple please let me know.
+
+BTW, wx.Platform will probably be deprecated in the future.
+
+
Other Stuff
-----------
#ifdef __WXMOTIF__
#define wxPlatform "__WXMOTIF__"
+#define wxPlatName "wxMotif"
#endif
#ifdef __WXX11__
#define wxPlatform "__WXX11__"
+#define wxPlatName "wxX11"
#endif
#ifdef __WXGTK__
#define wxPlatform "__WXGTK__"
+#define wxPlatName "wxGTK"
#endif
-#if defined(__WIN32__) || defined(__WXMSW__)
+#ifdef __WXMSW__
#define wxPlatform "__WXMSW__"
+#define wxPlatName "wxMSW"
#endif
#ifdef __WXMAC__
#define wxPlatform "__WXMAC__"
+#define wxPlatName "wxMac"
#endif
#ifdef __WXDEBUG__
int wxdebug = 0;
#endif
+ // These should be deprecated in favor of the PlatformInfo tuple built below...
PyDict_SetItemString(wxPython_dict, "Platform", PyString_FromString(wxPlatform));
PyDict_SetItemString(wxPython_dict, "USE_UNICODE", PyInt_FromLong(wxUSE_UNICODE));
PyDict_SetItemString(wxPython_dict, "__WXDEBUG__", PyInt_FromLong(wxdebug));
+
+ PyObject* PlatInfo = PyList_New(0);
+ PyObject* obj;
+
+#define _AddInfoString(st) \
+ obj = PyString_FromString(st); \
+ PyList_Append(PlatInfo, obj); \
+ Py_DECREF(obj)
+
+ _AddInfoString(wxPlatform);
+ _AddInfoString(wxPlatName);
+#if wxUSE_UNICODE
+ _AddInfoString("unicode");
+#else
+ _AddInfoString("ascii");
+#endif
+#ifdef __WXGTK__
+#ifdef __WXGTK20__
+ _AddInfoString("gtk2");
+#else
+ _AddInfoString("gtk1");
+#endif
+#endif
+
+#undef _AddInfoString
+
+ PyObject* PlatInfoTuple = PyList_AsTuple(PlatInfo);
+ Py_DECREF(PlatInfo);
+ PyDict_SetItemString(wxPython_dict, "PlatformInfo", PlatInfoTuple);
+
RETURN_NONE();
}