X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e166644c534521f311e4f010b0829c7c9951e7a3..fa482912e420a40e9f2e55a0f5407562826dd15e:/utils/wxPython/lib/wxpTag.py diff --git a/utils/wxPython/lib/wxpTag.py b/utils/wxPython/lib/wxpTag.py index a4f372ec3f..4cc06d6eff 100644 --- a/utils/wxPython/lib/wxpTag.py +++ b/utils/wxPython/lib/wxpTag.py @@ -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 @@ -208,13 +211,13 @@ class wxpTagHandler(wxHtmlWinTagHandler): # convert to wxColour elif value[0] == '#': - #try: + try: red = string.atoi('0x'+value[1:3], 16) green = string.atoi('0x'+value[3:5], 16) blue = string.atoi('0x'+value[5:], 16) value = wxColor(red, green, blue) - #except: - # pass + except: + pass self.ctx.kwargs[name] = value return false