On Jun 7, 2006, at 5:39 AM, Alex Tweedly wrote:
Earlier you suggested changing to use beforeInit in the BaseForm,
and that worked perfectly in the tiny, cut-down example I sent. But
when I tried to put that back into the real code, it failed; it
failed because what is needed is that the dForm is initialized
first, then BaseForm should create and layout the controls/sizers,
and then the DemoForm can do some further setup on the controls.
Therefore, in the real example,
BaseForm can't use beforeInit - the dForm isn't initialized yet.
It can't easily use __init__ as you explained above
and it can't (simply) use afterInit, because that never gets called
(only the afterInit in DemoForm is called).
When you want something to happen after all the other stuff is done,
put it in its own method, and use dabo.ui.callAfter() to add it to
the back of the event queue. So your code might look like:
BaseForm:
def doAfterInitStuff(self):
# Do your Base post setup here
DemoForm:
def afterInit(self):
dabo.ui.callAfter(self.doAfterInitStuff)
def doAfterInitStuff(self):
super(DemoForm, self).doAfterInitStuff()
# Do your Demo post setup here
-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users