From 7f4278425552fcdb95d26c855f7c698d51e241fc Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 17 Oct 2022 14:33:42 -0700 Subject: [PATCH] Fix code snippet in docs for XmlReseource.LoadDialog --- .../converted/wx.xrc.XmlResource.LoadDialog.1.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xrc.XmlResource.LoadDialog.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xrc.XmlResource.LoadDialog.1.py index 8711b7e8..da5bca34 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xrc.XmlResource.LoadDialog.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xrc.XmlResource.LoadDialog.1.py @@ -1,3 +1,10 @@ + # Without a class + dlg = wx.Dialog() + wx.xml.XmlResource.Get().LoadDialog(dlg, mainFrame, "my_dialog") + dlg.ShowModal() - dlg = wx.xml.XmlResource.Get().LoadDialog(mainFrame, "my_dialog") - dlg.ShowModal() + # Or, as a class + class MyDialog(wx.Dialog): + def __init__(self, parent): + super().__init__() + wx.xml.XmlResource.Get().LoadDialog(self, parent, "my_dialog")