%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
%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;
~wxGLContext();
void SetCurrent();
- void SetColour(const char *colour);
+ void SetColour(const wxString& colour);
void SwapBuffers();
#ifdef __WXGTK__
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);
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 );
%pragma(python) addtomethod = "wxGLCanvasWithContext:val._setOORInfo(self)"
void SetCurrent();
- void SetColour(const char *colour);
+ void SetColour(const wxString& colour);
void SwapBuffers();
wxGLContext* GetContext();
%init %{
- wxClassInfo::CleanUpClasses();
- wxClassInfo::InitializeClasses();
-
%}
//---------------------------------------------------------------------------