[General lang] how to call a parent

Aahz aahz at pythoncraft.com
Sun Jun 15 12:38:26 EDT 2003


In article <F%0Ha.261$WW3.30765151 at newssvr21.news.prodigy.com>,
John Fabiani  <jfabiani at yolo.com> wrote:
>
>I'm a newbie to the Python world but not programming.  In the Visual
>Foxpro world we have the concept of ?parent?.  I normally use it to
>set properties of a custom control as in ?parent.background.color =
>blue?.  The parent in this case is a container.  In the VFP world we
>have ?thisform, this, and parent? and all class methods are run unless
>overwritten by the child class.  Anyway, I'd know how to call the
>parent of an object.  BTW if I'm all wrong with this idea would someone
>explain why!

It's not that you're all wrong as that what you're describing is a
special form of object protocol that primarily applies in GUI design.
You can certainly perform this kind of operation in Python, but unless
you're using a framework, it's not automatic.  Before I (or other
people) give you specific advice about the best way to implement this,
it'd be good if you gave us more information about what you're trying to
accomplish.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"If you don't know what your program is supposed to do, you'd better not
start writing it."  --Dijkstra




More information about the Python-list mailing list