>
> import dabo
> dabo.ui.loadUI("wx")
>
> class MyTextBox(dabo.ui.dTextBox):
> def _getMyProp(self):
> return getattr(self, "_myProp", None)
> def _setMyProp(self, val):
> self._myProp = val
> MyProp = property(_getMyProp, _setMyProp)
>
> if __name__ == "__main__":
> app = dabo.dApp()
> app.setup()
> tb = MyTextBox(app.MainForm, MyProp="Test value")
> print tb.MyProp
> app.start()
>
> #-- end test code
>
> Other than that, you aren't going to get afterInit() to see an argument
> passed to __init__(), but you could code your class like:
>
> class MyTextBox(zdabo.ui.dTextBox):
> def __init__(self, myArg=None, *args, **kwargs):
> self.super()
> self.myArg = myArg
>
> and now you can reference the myArg attribute from whereever you like.
Paul using the first option (setting a Property) how can I pass an object?
I.e I'd like to pass the calling form to class MyTextBox.
Actually, any object!
--
John Fabiani
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users