From: W. Trevor King Date: Sun, 22 Aug 2010 18:10:02 +0000 (-0400) Subject: Add menu title hotkeys to the GUI. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5d63af7daea58680d6eba5237d09786e58818c0b;p=hooke.git 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." --- 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)