htmlWindow SetLinkColor

Trying to change the default link color in an htmlWindow. Can't seem
to get it to work. Tried the way below and also tried a,

Any suggestions?

···

------------------------------------------------------------

import wx, wx.html

class HtmlDemo(wx.Frame):
    def __init__(self, parent):
        wx.Frame.__init__(self, parent, style =
wx.DEFAULT_FRAME_STYLE)

        self.demoWindow = wx.html.HtmlWindow(self, -1, style =
wx.WANTS_CHARS)

        self.demoWindow.GetParser().SetLinkColor(wx.Colour(128, 0, 0))

        t = '''Link: <a href="http://www.google.com">Link</a>'''
        self.demoWindow.SetPage(t)

class MyApp(wx.App):
    def OnInit(self):
        Demo = HtmlDemo(None)
        Demo.Show()
        return 1

if __name__ == "__main__":
    app = MyApp(0)
    app.MainLoop()

--------------------------------------------------------------------

Also tried,

class HtmlWindow(wx.html.HtmlWindow):
    def __init__(self, parent, id, style):
        wx.html.HtmlWindow.__init__(self, parent, id, style=style)

        self.GetParser().SetLinkColor(wx.Colour(128, 0, 0))

Do the color change from within the HTML, in the <body> tag.

link.py (610 Bytes)

···

On 10/9/10 7:33 AM, tsmorton wrote:

Trying to change the default link color in an htmlWindow. Can't seem
to get it to work. Tried the way below and also tried a,

Any suggestions?

--
Robin Dunn
Software Craftsman