>
> wx.Dialog, wx.TextCtrl are subclassed, problem is don't created
> 'aTCtrl'.
> after run, error message box shows "Subclass 'menculator.MyTextCtrl'
> not found for resource 'aTCtrl', not subclassing!"
> I tested LoadDialog function that create child widgets against
> LoadOnDialog.
> how do i solve it?
You have some problems:
1. The subclassing factory works by importing the module where the class
resides. Since this is the same as your main script in this case you
need to be sure to protect the call to main() so it is not executed
again when XRC imports the module:
if __name__ == '__main__':
main()
2. When XRC creates an instance of the class specified in the subclass
attribute it calls it with no parameters. Your sample has
MyTextCtrl.__init__ expecting a parent parameter.
3. self._firstEventType does not exist.
4. Not really a problem per se, but not really a good approach to take:
You've got MCDialog loading itself from the XRC, but it is also using
the subclass attribute in the XRC. IMO you should choose one or the
other approach, not both.
--
Robin Dunn
Software Craftsman
http://wxPython.org