Hello,
I'm
trying to create a wx.xrc.XmlDocument object with some child nodes and
save it to a file. This is for a sort of reconfigurable user interface.
However, I’m having a lot of trouble with the xrc classes, I’m not sure
if they’re buggy or if i’m not using them right…
Basically, code similar to the following
somtimes crashes the interpreter, sometimes generates a MemoryError, and
sometimes seems to work OK:
doc = xrc.EmptyXmlDocument()
rootNode = xrc.XmlNode(None, xrc.XML_ELEMENT_NODE,
“resource”, “”, None)
doc.SetRoot(rootNode)
prop = xrc.XmlProperty(“class”,
“SomeClass”)
someNode = xrc.XmlNode(rootNode, xrc.XML_ELEMENT_NODE,
“object”, “”, prop)
The above code is inside of a method,
and the method seems to complete correctly (I put a print statement as
the last line in the method), but when returning to the calling method,
the interpreter usually crashes.
Does anyone have any ideas? Know where
I can find more documentation on how to use XRC? Any help will be greatly
appreciated.
–Matt Harriger