From 5d63af7daea58680d6eba5237d09786e58818c0b Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 22 Aug 2010 14:10:02 -0400 Subject: [PATCH] Add menu title hotkeys to the GUI. From http://wiki.wxwidgets.org/Beech:Using_controls#Adding_a_Menu_Bar we have "Note how the ampersand ("&") is used in strings like "E&xit" and "&File". This indicates which character in a menubar or menu will be the menu hotkey." --- hooke/ui/gui/menu.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hooke/ui/gui/menu.py b/hooke/ui/gui/menu.py index d918a94..7ee0b2e 100644 --- a/hooke/ui/gui/menu.py +++ b/hooke/ui/gui/menu.py @@ -187,9 +187,10 @@ class HookeMenuBar (MenuBar): # Attach *Menu() instances for key in ['file', 'view', 'perspective', 'help']: cap_key = key.capitalize() + hot_key = '&' + cap_key _class = globals()['%sMenu' % cap_key] kwargs = {} if key == 'view': kwargs['panels'] = panels self._c[key] = _class(parent=self, callbacks=callbacks, **kwargs) - self.Append(self._c[key], cap_key) + self.Append(self._c[key], hot_key) -- 2.26.2