Alex Tweedly wrote:
I initially tried it with DemoForm being based on BaseForm, which was in turn based on dabo.ui.dForm (that's what I really wanted),

import dabo
dabo.ui.loadUI("wx")

class BaseForm(dabo.ui.dForm):
   def __init__(self):
       self.done = True

class DemoForm(BaseForm):
   def afterInit(self):
       print self.done

def main():
   app = dabo.dApp()
   app.MainFormClass = DemoForm
   app.start()

if __name__ == '__main__':
   main()

but when you do that, with __init__, it all goes sadly wrong (I don't, to be honest, understand why - but using this form with beforeInit in place of __init__ works perfectly).

It is because there's a ton of stuff in dForm's __init__. Specifically, the functionality is in the __init__'s of dFormMixin, dPemMixin, and dObject. Your example above never let the superclass __init__ code run, so among other things the wxFrame never got to be initialized.

This is why, for Dabo code, you never want to override __init__ (and if you do, you need to take responsibility for correctly calling the superclass __init__).

Note to self: we need to highlight this in the Dabo documentation, right up front and repeat it often!

--
Paul McNett
http://paulmcnett.com
http://dabodev.com


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Reply via email to