Files
Phoenix/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xrc.XmlResource.LoadDocument.1.py
2022-05-17 19:49:31 -07:00

13 lines
340 B
Python

xrc_data = ... # Retrieve it from wherever.
xmlDoc = wx.xml.XmlDocument(io.BytesIO(xrc_data))
if not xmlDoc.IsOk():
... handle invalid XML here ...
return
if not wx.XmlResource.Get().LoadDocument(xmlDoc):
... handle invalid XRC here ...
return
... use the just loaded XRC as usual ...