]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxPython/lib/wxpTag.py
Committing in .
[wxWidgets.git] / utils / wxPython / lib / wxpTag.py
index afdfd4c1beb1276da5dda853e4edd12946666efa..4cc06d6eff836b86e80f14a75ce61fb8e7bbf1d0 100644 (file)
@@ -163,14 +163,17 @@ class wxpTagHandler(wxHtmlWinTagHandler):
         self.ParseInner(tag)
 
         # create the object
-        obj = apply(self.ctx.classObj,
-                    (self.GetParser().GetWindow(),),
-                    self.ctx.kwargs)
-        obj.Show(true)
+        parent = self.GetParser().GetWindow()
+        if parent:
+            obj = apply(self.ctx.classObj,
+                        (parent,),
+                        self.ctx.kwargs)
+            obj.Show(true)
+
+            # add it to the HtmlWindow
+            self.GetParser().GetContainer().InsertCell(wxHtmlWidgetCell(obj, self.ctx.floatWidth))
+            self.ctx = None
 
-        # add it to the HtmlWindow
-        self.GetParser().GetContainer().InsertCell(wxHtmlWidgetCell(obj, self.ctx.floatWidth))
-        self.ctx = None
         return true