wxPython - How can I display a html formatted string in wx.RichTextCtrl

Posted by wxpydon on Stack Overflow See other posts from Stack Overflow or by wxpydon
Published on 2010-06-08T09:44:32Z Indexed on 2010/06/12 21:12 UTC
Read the original article Hit count: 218

Filed under:
|

Hello,

I'm trying to display some string (html formatted) in a Richtext Ctrl. In my code I tried to use it this way (self.txtmain is the RichTextCtrl):

out = StringIO()
htmlhandler = rt.RichTextHTMLHandler()
buffer = self.txtmain.GetBuffer()
buffer.AddHandler(htmlhandler)
out.write(string)
out.seek(0)
htmlhandler.LoadStream(buffer, out)
self.txtmain.Refresh()

No errors are issued, but the RichTextCtrl windows is not updated. What am I missing here?

© Stack Overflow or respective owner

Related posts about wxpython

Related posts about richtextctrl