How to use a cdxml file in hand coded forms

From Dabo Wiki
Jump to: navigation, search

NOTE: as of revision 4384, you can now do the following:

# Assuming that 'pth' is the path to the cdxml class
cls = dabo.ui.createClass(pth)
instance = cls(self, Foo="Bar", ...)

For earlier revisions:

Here is an example on how to use a cdxml file as class in a hand coded form:

from dabo.lib.DesignerXmlConverter import DesignerXmlConverter
conv = DesignerXmlConverter()
# Assuming that 'pth' is the path to the cdxml class
cls = conv.classFromXml(pth)
instance = cls(self, Foo="Bar", ...)