How to use a cdxml file in hand coded forms

From Dabo Wiki
Revision as of 14:35, 17 May 2020 by Ed (talk | contribs) (Created page with "'''<span style="color: red;">NOTE</span>''': as of revision '''4384''', you can now do the following: <syntaxhighlight lang="python"> # Assuming that 'pth' is the path to the...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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", ...)