By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,996 Members | 1,498 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,996 IT Pros & Developers. It's quick & easy.

Default event handlers in wxPython

P: n/a
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.EVT_MENU_HIGHLIGHT, self.OnMenuHighlight)

def OnMenuHighlight(self, event):
self.SetStatusText(event.GetEventObject().GetHelpS tring(event.GetMenuId()),
1)

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

self.Bind(wx.EVT_TOOL_ENTER, self.OnToolbarHighlight)
def OnToolbarHighlight(self, event):
self.SetStatusText(event.GetEventObject().GetToolL ongHelp(event.GetSelection()),
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
Jan 15 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.