wxPython - How can I display a html formatted string in wx.RichTextCtrl
- by wxpydon
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?