Problem handling mouse-click on subclass ofStaticText

Grant Edwards:

I need to handle mouse clicks on StaticText widgets. I've
defined this class:

class ClickableLabel(wx.StaticText):
    def __init__(self, *args, **kwargs):
        h = kwargs['handler']
        del kwargs['handler']
        wx.StaticText.__init__(self, *args, **kwargs)
        if h:
            self.Bind(wx.EVT_LEFT_UP,h)

Not sure if this helps, but FYI, if you add the line 'from wx.lib.stattext
import GenStaticText', and then derive from GenStaticText instead of
wx.StaticText, a whole lot of functionality that is missing from
wx.StaticText becomes available.

For example, I use it to display a tooltip when the mouse hovers over a
particular piece of static text.

HTH

Frank Millman