Dan Eloff wrote:
I don't really understand what the parent argument does, and I think
it's causing me trouble.I have a control: frame -> panel1 -> panel2 -> control
It is difficult to give the control panel2 as an argument (control is
created before panel2) but easy to give it panel1. I've been using
partial() in python 2.5 and passing the control as a function taking
just parent and returning the control, but it occurs to me this might
not be required. What differences might there be in using panel1 as
the parent?I notice that the StaticBoxSizer example in Robin Dunn's book the
controls that go inside the static box get the outer container as
parent (not the StaticBox) but end up in the box and seem to work
fine. That got me thinking that maybe I don't need to enforce a strict
parent->child relationship based on who contains what.
The staticbox is the one exception to the rule. Basically it works that way (being a sibling to the controls is appears to contain) because it doesn't draw its background in the interior area, and wxWidgets enforces this sibling relationship because one of the platforms requires it.
In all other cases you should make widgets be children of the widget that contains them.
ยทยทยท
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!