Possible and wise to subclass in Python?

If so, how hard is it to subclass controls? Any good tutorial links?

Scott wrote:

Yes.

If so, how hard is it to subclass controls?

It depends on the control and what you want to do with it. If you just want to catch and process events then no problem. If you want to change the look of behavior of the native control then that is tricky and in most cases is not recommended (or even possible.) If you want to create a custom control from scratch then there are a couple samples in the wxPython library, see wxPython/lib/buttons.py and stattext.py.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Thanks for the reply Robin. You are so helpful on the mailing list, I'm
surprised you have any time to work on the library or anything else!
Thanks for the guidance; hopefully I'll get up to speed on this stuff so
I don't have to ask for help. You are cool!

:slight_smile:

···

On Mon, 07 Apr 2003 13:26:00 -0700 Robin Dunn <robin@alldunn.com> wrote:

Yes.

> If so, how hard is it to subclass controls?

It depends on the control and what you want to do with it. If you
just want to catch and process events then no problem. If you want to
change the look of behavior of the native control then that is tricky
and in most cases is not recommended (or even possible.) If you want
to create a custom control from scratch then there are a couple
samples in the wxPython library, see wxPython/lib/buttons.py and
stattext.py.