[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] subclassing rect



Hello Pete,

Wednesday, July 3, 2002, 6:33:29 PM, you wrote:
> to make for them to really work. i noticed if the subclass doesn't have its
> own __init__ method, you can instance the classes fine, but any new methods 
> you add to the class don't seem to show up, hrmmm..

I just gave it a try. Modifying the rect_new() function in rect.c
allowed me to create subclasses of the Rect type. The only problem now
is that the rect_getattr()/rect_setattr() functions don't seem to be
called anymore. So the attributes you defined in them aren't working.
My guess is that with Python 2.2 these should be defined using the
tp_members or tp_getget fields of PyTypeObject structure.

Can I send you the code to your private email? I'm not sure if this
mailing list is also about discussing the development of PyGame
itself.

-- 
Marc Schefer - codexus@codexus.com

____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org