X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d3bfec747ddf7b27e6f41f0117cd5cd6755fe021..e422162882bf4c5ae743fd618864e97206765fca:/wxPython/src/gdi.i diff --git a/wxPython/src/gdi.i b/wxPython/src/gdi.i index 349699d6d3..a47f4a3362 100644 --- a/wxPython/src/gdi.i +++ b/wxPython/src/gdi.i @@ -110,7 +110,7 @@ public: %new wxBitmap* wxEmptyBitmap(int width, int height, int depth=-1); %new wxBitmap* wxBitmapFromXPMData(PyObject* listOfStrings); %new wxBitmap* wxBitmapFromIcon(const wxIcon& icon); -%new wxBitmap* wxBitmapFromBits(char* bits, int width, int height, int depth = 1 ); +%new wxBitmap* wxBitmapFromBits(PyObject* bits, int width, int height, int depth = 1 ); // #ifdef __WXMSW__ // %new wxBitmap* wxBitmapFromData(PyObject* data, long type, @@ -162,8 +162,11 @@ public: } - wxBitmap* wxBitmapFromBits(char* bits, int width, int height, int depth = 1 ) { - return new wxBitmap(bits, width, height, depth); + wxBitmap* wxBitmapFromBits(PyObject* bits, int width, int height, int depth = 1 ) { + char* buf; + int length; + PyString_AsStringAndSize(bits, &buf, &length); + return new wxBitmap(buf, width, height, depth); } @@ -423,9 +426,21 @@ public: void SetStyle(int style); void SetWidth(int width); - // **** This one needs to return a list of ints (wxDash) - //int GetDashes(wxDash **dashes); + void SetDashes(int LCOUNT, wxDash* choices); + //int GetDashes(wxDash **dashes); + %addmethods { + PyObject* GetDashes() { + wxDash* dashes; + int count = self->GetDashes(&dashes); + wxPyBeginBlockThreads(); + PyObject* retval = PyList_New(0); + for (int x=0; x