diff --git a/etg/bitmap.py b/etg/bitmap.py index b7df9156..fbb83e6c 100644 --- a/etg/bitmap.py +++ b/etg/bitmap.py @@ -42,11 +42,42 @@ def run(): tools.removeVirtuals(c) - c.find('wxBitmap').findOverload('(const char *const *bits)').ignore() c.find('wxBitmap.bits').type = 'const char*' c.find('wxBitmap.type').default = 'wxBITMAP_TYPE_ANY' c.find('LoadFile.type').default = 'wxBITMAP_TYPE_ANY' + c.find('wxBitmap').findOverload('(const char *const *bits)').ignore() + + c.addCppCtor('(PyObject* listOfBytes)', + doc="Construct a Bitmap from a list of strings formatted as XPM data.", + body="""\ + wxPyThreadBlocker blocker; + char** cArray = NULL; + int count; + char errMsg[] = "Expected a list of bytes objects."; + + if (!PyList_Check(listOfBytes)) { + PyErr_SetString(PyExc_TypeError, errMsg); + return NULL; + } + count = PyList_Size(listOfBytes); + cArray = new char*[count]; + + for(int x=0; x