Ok, I am using python 2.2 and wxPython for 2.2 on windows XP and I tried
the macro in the frame and it worked, I have been trying to do this for
a panel in the frame and it doesn't appear to work. Is
EVT_MENU_HIGHLIGHT_ALL() not defined in the context of the panel? Or is
that these events are not generated for popup windows? Maybe I am
overthinking this.
Thanks in advance.
Sam
Sam Hendley wrote:
What I am trying to do is get menu's on multiple panels to all show
their help messages on the same status bar. The problem I have is
that
EVT_MENU_HIGHLIGHT(self,id,func),
EVT_MENU_HIGHLIGHT_ALL(self,self.func)
don't appear to do anything.
What's your platform and version?
I saw somewhere that this macro wasn't
implemented but I think that document was dated. I also tried to use
the frame.OnMenuHighlight method and it doesn't exist. If I use
frame.CreateStatusBar() I can get the help text from the menu bar to
go
to the status bar but I cant figure out where this event is getting
handled. I've tried overloading OnMenuHighlight but that doesn't get
activated and the help text still makes it to the status bar. Any
help
would be greatly appreciated.
This works for me, where self is the wxFrame:
EVT_MENU_HIGHLIGHT_ALL(self, self.OnMenuHighlight)
...
def OnMenuHighlight(self, event):
# Show how to get menu item imfo from this event handler
id = event.GetMenuId()
item = self.GetMenuBar().FindItemById(id)
text = item.GetText()
help = item.GetHelp()
print text, help