Using property() to extend Tkinter classes but Tkinter classes are old-style classes?

python at bdurham.com python at bdurham.com
Sun Nov 28 15:47:24 EST 2010


I had planned on subclassing Tkinter.Toplevel() using property()
to wrap access to properties like a window's title.

After much head scratching and a peek at the Tkinter.py source, I
realized that all Tkinter classes are old-style classes (even
under Python 2.7).

1. Is there a technical reason why Tkinter classes are still
old-style classes?

2. Is there a technique I can use to get property() to work with
old-style classes? Or, must I use composition and wrap a
reference to a Tkinter.Toplevel() window in a new style class?

Thanks,
Malcolm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20101128/88484cfd/attachment.html>


More information about the Python-list mailing list