Summary

■ HTML is not just for the Internet anymore. In wxPython, you can use an HTML window to display text with a simple subset of HTML markup. The HTML window is of the class wx.html.HtmlWindow. In addition to HTML text, the HTML window can manage any image that has a currently loaded image handler.

■ You can give the HTML window its display information as a string, a local file, or a URL. You can respond to a user click either as a hypertext browser normally would, or with a custom response of your own. You can also connect the HTML window to its frame so that the title and status information automatically displays in the correct locations. The HTML window maintains a history list that you can access and manipulate. You can use the class wx.Html.HtmlEasyPrinting to print your page straightforward.

■ There is an HTML parser in wxPython that you can use to create your own custom tags for your window. You can also set up custom file filters to render other file formats to an HTML window.

■ Finally, if you get frustrated with the limitations of the HTML window, a wrapper around the Internet Explorer ActiveX control is available. If you aren't on Windows, there's a beta version of a wrapper around the Mozilla Gecko HTML renderer.

Was this article helpful?

0 0

Post a comment