Default event handlers in wxPython

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tom Wright

    #1

    Default event handlers in wxPython

    Hi all

    I'm writing my first wxPython app and am having a problem with event
    handlers. I've set up a multi-part status bar and would like all the
    tooltips, menu help strings etc. to go into the second part of it. Is
    there some easy way of doing this?

    I've not found one, so have set up the following for the menu:

    self.Bind(wx.EV T_MENU_HIGHLIGH T, self.OnMenuHigh light)

    def OnMenuHighlight (self, event):
    self.SetStatusT ext(event.GetEv entObject().Get HelpString(even t.GetMenuId()),
    1)

    ....this works fine. I've tried to set up the same for the toolbar:

    self.Bind(wx.EV T_TOOL_ENTER, self.OnToolbarH ighlight)
    def OnToolbarHighli ght(self, event):
    self.SetStatusT ext(event.GetEv entObject().Get ToolLongHelp(ev ent.GetSelectio n()),
    1)

    ....and this doesn't work. Well, it puts the text in the second part of the
    toolbar as requested, but the default handler is still being called and
    this messes up the first part of the toolbar which I want it to leave
    alone. How do I completely override the default handler for the toolbar?
    This method worked fine for menus and I'm a bit stuck.

    (ignore the indentation on the above examples - I know it's wrong, but long
    lines and usenet don't mix)


    --
    I'm at CAMbridge, not SPAMbridge
Working...