X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9cbf6f6ea3ce56a15841a4f773bffef71c92c398..71aba8333cc915afff9e740c944f7fa7247abacb:/wxPython/src/image.i diff --git a/wxPython/src/image.i b/wxPython/src/image.i index 8e001f0d11..be25dd688d 100644 --- a/wxPython/src/image.i +++ b/wxPython/src/image.i @@ -317,6 +317,7 @@ public: static void AddHandler( wxImageHandler *handler ); static void InsertHandler( wxImageHandler *handler ); static bool RemoveHandler( const wxString& name ); + static wxString GetImageExtWildcard(); %addmethods { @@ -333,11 +334,13 @@ public: return bitmap; } } + + %pragma(python) addtoclass = "def __nonzero__(self): return self.Ok()" }; // Alternate constructors -%new wxImage* wxEmptyImage(int width=0, int height=0); +%new wxImage* wxEmptyImage(int width=0, int height=0, bool clear = TRUE); %new wxImage* wxImageFromMime(const wxString& name, const wxString& mimetype, int index = -1); %new wxImage* wxImageFromBitmap(const wxBitmap &bitmap); %new wxImage* wxImageFromData(int width, int height, unsigned char* data); @@ -345,11 +348,11 @@ public: %new wxImage* wxImageFromStreamMime(wxInputStream& stream, const wxString& mimetype, int index = -1 ); %{ - wxImage* wxEmptyImage(int width=0, int height=0) { - if (width == 0 && height == 0) - return new wxImage; + wxImage* wxEmptyImage(int width=0, int height=0, bool clear = TRUE) { + if (width > 0 && height > 0) + return new wxImage(width, height, clear); else - return new wxImage(width, height); + return new wxImage; } @@ -397,6 +400,7 @@ void wxInitAllImageHandlers(); #if 0 %} +// See also wxPy_ReinitStockObjects in helpers.cpp extern wxImage wxNullImage; %readwrite