X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dd9f7fea29e3f8bb61861f52984b7943512346ac..93b663b8ccc9f82dd32d492c8a6081a8c75e8419:/wxPython/src/_colour.i diff --git a/wxPython/src/_colour.i b/wxPython/src/_colour.i index d7557387a0..f16e701c48 100644 --- a/wxPython/src/_colour.i +++ b/wxPython/src/_colour.i @@ -30,11 +30,13 @@ public: unsigned char Blue(); bool Ok(); void Set(unsigned char red, unsigned char green, unsigned char blue); - %name(SetRBG) void Set(unsigned long colRGB); + %name(SetRGB) void Set(unsigned long colRGB); bool operator==(const wxColour& colour) const; bool operator != (const wxColour& colour) const; + void InitFromName(const wxString& colourName); + %extend { PyObject* Get() { PyObject* rv = PyTuple_New(3); @@ -73,13 +75,17 @@ public: %pythoncode { asTuple = Get def __str__(self): return str(self.asTuple()) - def __repr__(self): return 'wxColour' + str(self.asTuple()) + def __repr__(self): return 'wx.Colour' + str(self.asTuple()) def __nonzero__(self): return self.Ok() - def __getinitargs__(self): return () - def __getstate__(self): return self.asTuple() - def __setstate__(self, state): self.Set(*state) + __safe_for_unpickling__ = True + def __reduce__(self): return (Colour, self.Get()) } }; +// %pythoncode { +// Color = Colour +// NamedColor = NamedColour +// } + //---------------------------------------------------------------------------