summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1999-12-15 15:45:23 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1999-12-15 15:45:23 (GMT)
commitc15e43a2da0bee955d5e939e31c43f8dc6270fef (patch)
tree49443898698d926ce363fe21919ca89dc693fa5d /Mac
parent8a9fdff6d741825d9e2ececbdcd80f7bf65021fc (diff)
downloadcpython-c15e43a2da0bee955d5e939e31c43f8dc6270fef.zip
cpython-c15e43a2da0bee955d5e939e31c43f8dc6270fef.tar.gz
cpython-c15e43a2da0bee955d5e939e31c43f8dc6270fef.tar.bz2
Fixed menu glyph stuff.
Use MenuEvent in stead of MenuKey.
Diffstat (limited to 'Mac')
-rw-r--r--Mac/Lib/FrameWork.py25
1 files changed, 10 insertions, 15 deletions
diff --git a/Mac/Lib/FrameWork.py b/Mac/Lib/FrameWork.py
index c073abd..e56679d 100644
--- a/Mac/Lib/FrameWork.py
+++ b/Mac/Lib/FrameWork.py
@@ -311,26 +311,21 @@ class Application:
def do_key(self, event):
(what, message, when, where, modifiers) = event
c = chr(message & charCodeMask)
+ if self.menubar:
+ result = MenuEvent(event)
+ id = (result>>16) & 0xffff # Hi word
+ item = result & 0xffff # Lo word
+ if id:
+ self.do_rawmenu(id, item, None, event)
+ return
+ # Otherwise we fall-through
if modifiers & cmdKey:
if c == '.':
raise self
else:
if not self.menubar:
MacOS.HandleEvent(event)
- return
- result = MenuKey(ord(c))
- id = (result>>16) & 0xffff # Hi word
- item = result & 0xffff # Lo word
- if id:
- self.do_rawmenu(id, item, None, event)
-# elif c == 'w':
-# w = FrontWindow()
-# if w:
-# self.do_close(w)
-# else:
-# if DEBUG: print 'Command-W without front window'
- else:
- if DEBUG: print "Command-" +`c`
+ return
else:
# See whether the front window wants it
w = FrontWindow()
@@ -533,7 +528,7 @@ class Menu:
self.menu.SetItemCmd(item, ord(char))
self.menu.SetMenuItemModifiers(item, modifiers)
if len(shortcut) > 2:
- self.menu.SetMenuItem
+ self.menu.SetMenuItemKeyGlyph(item, shortcut[2])
elif shortcut:
self.menu.SetItemCmd(item, ord(shortcut))
return item