X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c3819e4aa45945041544d4ae60dd92aa6e359c56..71aba8333cc915afff9e740c944f7fa7247abacb:/wxPython/contrib/glcanvas/glcanvas.i diff --git a/wxPython/contrib/glcanvas/glcanvas.i b/wxPython/contrib/glcanvas/glcanvas.i index bb5620d857..f1f23d3fad 100644 --- a/wxPython/contrib/glcanvas/glcanvas.i +++ b/wxPython/contrib/glcanvas/glcanvas.i @@ -14,7 +14,12 @@ %module glcanvas %{ -#include "export.h" +#include "wxPython.h" + +#ifdef __WXMAC__ // avoid a bug in Carbon headers +#define scalb scalbn +#endif + #ifdef __WXMSW__ #include "myglcanvas.h" #else @@ -42,6 +47,14 @@ %pragma(python) code = "import wx" +//---------------------------------------------------------------------- + +%{ + // Put some wx default wxChar* values into wxStrings. + static const wxString wxPyGLCanvasNameStr(wxT("GLCanvas")); + static const wxString wxPyEmptyString(wxT("")); +%} + //--------------------------------------------------------------------------- class wxPalette; @@ -61,7 +74,7 @@ public: ~wxGLContext(); void SetCurrent(); - void SetColour(const char *colour); + void SetColour(const wxString& colour); void SwapBuffers(); #ifdef __WXGTK__ @@ -121,7 +134,7 @@ public: wxGLCanvas(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const char* name = "GLCanvas", + const wxString& name = wxPyGLCanvasNameStr, int *attribList = NULL, const wxPalette& palette = wxNullPalette); @@ -132,7 +145,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const char* name = "GLCanvas", + const wxString& name = wxPyGLCanvasNameStr, int *attribList = NULL, const wxPalette& palette = wxNullPalette ); @@ -143,7 +156,7 @@ public: %pragma(python) addtomethod = "wxGLCanvasWithContext:val._setOORInfo(self)" void SetCurrent(); - void SetColour(const char *colour); + void SetColour(const wxString& colour); void SwapBuffers(); wxGLContext* GetContext(); @@ -161,9 +174,6 @@ public: %init %{ - wxClassInfo::CleanUpClasses(); - wxClassInfo::InitializeClasses(); - %} //---------------------------------------------------------------------------