On Jan 27, 2005, at 15:24, Dethe Elza wrote:
FYI, once I updated PyObjC from svn, my example code worked, thanks again Ronald....
class NSImage(Category(NSImage)):
def rect(self): return (0,0),self.size()
@classmethod # for Python2.3 replace with read_ = classmethod(read_)
def read_(cls, filepath):
return NSImage.alloc().initWithContentsOfFile_(filepath)
Just a nit here, you should probably call this imageWithFilePath_ to follow convention. "read:" is a really confusing name for an initializer.
-bob
_______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig