EventFilter Example Fails

[email protected]
Newsgroups gmane.comp.python.wxpython.devel
Message-ID <[email protected]>
I tried a simplified version of the event filter example found
at http://wxpython.org/Phoenix/docs/html/EventFilter.html

class KeyEventFilter(wx.EventFilter):
    def __init__(self):
        wx.EventFilter.__init__(self)
        wx.EvtHandler.AddFilter(self)

    def __del__(self):
        wx.EvtHandler.RemoveFilter(self)

    def FilterEvent(self, event):
        t = event.GetEventType()
        if t == wx.EVT_KEY_DOWN:
            print "key down"
        event.Skip()

When I try to instantiate the class

        filter = KeyEventFilter()

I get the following error message:

TypeError: wx._core.EventFilter cannot be instantiated or sub-classed

Is this example know to work?

Thanks,

Eric Nystrom

-- 
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.