I tried the code below but can’t figure out how to get my html text auto wrapped. But the one in wxPython demo works just perfect, any idea?
···
import wx
import wx.html as html
class Frame(wx.Frame):
def init(self, parent):
wx.Frame.init(self, None, wx.ID_ANY, ‘HTML Frame’, size=(500, 500))
panel = wx.Panel(self, -1)
self.html = html.HtmlWindow(panel, -1, style=wx.NO_FULL_REPAINT_ON_RESIZE)
self.html.SetRelatedFrame(self, “–”)
self.html.SetPage(‘hahahahahahahahahahahahahahahahahahahahahahahaha’)
panel.box = wx.BoxSizer(wx.VERTICAL)
panel.box.Add(self.html, 1, wx.GROW)
panel.SetSizer(panel.box)
panel.SetAutoLayout(True)
self.Show()
def main():
app = wx.App()
frame = Frame(None)
app.MainLoop()
if name == “main”:
import sys,os
main()