@@ -528,7 +528,13 @@ def additem(self, label, shortcut=None, callback=None, kind=None):
528528 self .items .append (label , shortcut , callback , kind )
529529 item = len (self .items )
530530 self .menu .SetMenuItemText (item , label ) # set the actual text
531- if shortcut :
531+ if shortcut and type (shortcut ) == type (()):
532+ modifiers , char = shortcut [:2 ]
533+ self .menu .SetItemCmd (item , ord (char ))
534+ self .menu .SetMenuItemModifiers (item , modifiers )
535+ if len (shortcut ) > 2 :
536+ self .menu .SetMenuItem
537+ elif shortcut :
532538 self .menu .SetItemCmd (item , ord (shortcut ))
533539 return item
534540
@@ -1018,9 +1024,9 @@ def makeusermenus(self):
10181024 self .saveitem = MenuItem (m , "Save" , "S" , self .save )
10191025 Separator (m )
10201026 self .optionsmenu = mm = SubMenu (m , "Options" )
1021- self .opt1 = CheckItem (mm , "Arguments" )
1022- self .opt2 = CheckItem (mm , "Being hit on the head lessons" )
1023- self .opt3 = CheckItem (mm , "Complaints" )
1027+ self .opt1 = CheckItem (mm , "Arguments" , "A" )
1028+ self .opt2 = CheckItem (mm , "Being hit on the head lessons" , ( kMenuOptionModifier , "A" ) )
1029+ self .opt3 = CheckItem (mm , "Complaints" , ( kMenuOptionModifier | kMenuNoCommandModifier , "A" ) )
10241030 Separator (m )
10251031 self .quititem = MenuItem (m , "Quit" , "Q" , self .quit )
10261032
0 commit comments