Re: [Pyobjc-dev] NSRects and NSPoints as tuples...
Brought to you by:
ronaldoussoren
From: Bob I. <bo...@ma...> - 2003-01-08 17:08:12
|
On Wednesday, Jan 8, 2003, at 11:55 America/New_York, Dinu Gherman wrote: > I've read somewhere and experienced now myself that NSRects and > NSPoints are mapped to 2-2 and 2-tuples of numbers respectively. > > While this is surely more convenient and more Pythonic in most cir- > cumstances I feel like it has the drawback that existing Cocoa > code calling attributes like size, width/height or x/y of NSRect > will need to be "ported" to the more Pythonic way in a more than > just syntactical fashion. > > In this case it means going from rather clear names to numeric > indices, which have a higher potential to confuse their users. > > Am I correctly assuming that this is working "as designed", then? > ;-) pygame ( www.pygame.org ) does the equivalent of NSRect in its Rect class, and it's got all of the height/width/etc niceness.. might even be worth just yanking some of the code out and using that, as they have a bunch of nice functions for working on them as well. -bob |