wxHtmlWinTagHandler

I'm deriving a wxHtmlWinTagHandler.. trying to make it handle
'FORM,TABLE'. It handles FORM just fine, but it doesn't call HandleTag
when it visits a TABLE. Is there something special i have to do to
override the default behavior for TABLE, which is a tag that wxHtmlWindow
normally knows how to render?

I know it doesn't call visit_table because it should blow up.

This is the class, in whole:

class FormTagHandler(wxHtmlWinTagHandler):
    def __init__(self):
        wxHtmlWinTagHandler.__init__(self)
        
    def GetSupportedTags(self):
        return 'TABLE,FORM'
    
    def HandleTag(self, tag):
        tagname=tag.GetName().lower()
        m=getattr(self, 'visit_%s' % tagname)
        m(tag)
    
    def visit_table(self, tag):
        blow(up)
    
    def visit_form(self, tag):
        parser=self.GetParser()
        container=parser.OpenContainer()
        width, height=parser.GetWindow().GetSize()
        # FIXME - use a sizer?
        width=450
        height=100
        form_shell=wxPanel(parser.GetWindow(), -1, size=wxSize(width,
height))
        container.InsertCell(wxHtmlWidgetCell(form_shell))
        self.ParseInner(tag)

···

__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

Cory Dodt wrote:

I'm deriving a wxHtmlWinTagHandler.. trying to make it handle
'FORM,TABLE'. It handles FORM just fine, but it doesn't call HandleTag
when it visits a TABLE. Is there something special i have to do to
override the default behavior for TABLE, which is a tag that wxHtmlWindow
normally knows how to render?

I think that wxHtmlWinParser_AddTagHandler appends to the list so as you've seen the built in handler will be found first. However, the parser allows handlers to be pushed and popped so perhaps you can do it that way...

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!