X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3ef86e32ddee8d77078b1e18affa3cadcdc420d2..8ccff7d2116057a0e79db28491a6c7fdf4051a58:/wxPython/src/gtk/gdi.py diff --git a/wxPython/src/gtk/gdi.py b/wxPython/src/gtk/gdi.py index ee17f74465..50ae140e9c 100644 --- a/wxPython/src/gtk/gdi.py +++ b/wxPython/src/gtk/gdi.py @@ -307,7 +307,7 @@ class wxColourPtr(wxObjectPtr): return "<%s.%s instance; proxy of C++ wxColour instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) asTuple = Get def __str__(self): return str(self.asTuple()) - def __repr__(self): return 'wxColour:' + str(self.asTuple()) + def __repr__(self): return 'wxColour' + str(self.asTuple()) def __nonzero__(self): return self.Ok() def __getinitargs__(self): return () def __getstate__(self): return self.asTuple() @@ -325,13 +325,15 @@ class wxColourDatabasePtr(wxObjectPtr): def __init__(self,this): self.this = this self.thisown = 0 - def FindColour(self, *_args, **_kwargs): - val = gdic.wxColourDatabase_FindColour(self, *_args, **_kwargs) - if val: val = wxColourPtr(val) - return val - def FindColourNoAdd(self, *_args, **_kwargs): - val = gdic.wxColourDatabase_FindColourNoAdd(self, *_args, **_kwargs) - if val: val = wxColourPtr(val) + def __del__(self, delfunc=gdic.delete_wxColourDatabase): + if self.thisown == 1: + try: + delfunc(self) + except: + pass + def Find(self, *_args, **_kwargs): + val = gdic.wxColourDatabase_Find(self, *_args, **_kwargs) + if val: val = wxColourPtr(val) ; val.thisown = 1 return val def FindName(self, *_args, **_kwargs): val = gdic.wxColourDatabase_FindName(self, *_args, **_kwargs) @@ -345,8 +347,9 @@ class wxColourDatabasePtr(wxObjectPtr): def __repr__(self): return "<%s.%s instance; proxy of C++ wxColourDatabase instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) class wxColourDatabase(wxColourDatabasePtr): - def __init__(self,this): - self.this = this + def __init__(self,*_args,**_kwargs): + self.this = gdic.new_wxColourDatabase(*_args,**_kwargs) + self.thisown = 1 @@ -1299,6 +1302,9 @@ class wxRegionIteratorPtr(wxObjectPtr): def Next(self, *_args, **_kwargs): val = gdic.wxRegionIterator_Next(self, *_args, **_kwargs) return val + def __nonzero__(self, *_args, **_kwargs): + val = gdic.wxRegionIterator___nonzero__(self, *_args, **_kwargs) + return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxRegionIterator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) class wxRegionIterator(wxRegionIteratorPtr):