Kaydet (Commit) bf0a9084 authored tarafından Just van Rossum's avatar Just van Rossum

Don't append quit menu when on OSX, it is special and automatic there.

üst 4e720385
...@@ -14,6 +14,14 @@ if MacOS.runtimemodel == 'macho': ...@@ -14,6 +14,14 @@ if MacOS.runtimemodel == 'macho':
else: else:
ELIPSES = '\xc9' ELIPSES = '\xc9'
def runningOnOSX():
from gestalt import gestalt
gestaltMenuMgrAquaLayoutBit = 1 # menus have the Aqua 1.0 layout
gestaltMenuMgrAquaLayoutMask = (1L << gestaltMenuMgrAquaLayoutBit)
value = gestalt("menu") & gestaltMenuMgrAquaLayoutMask
return not not value
class PythonIDE(Wapplication.Application): class PythonIDE(Wapplication.Application):
def __init__(self): def __init__(self):
...@@ -62,6 +70,9 @@ class PythonIDE(Wapplication.Application): ...@@ -62,6 +70,9 @@ class PythonIDE(Wapplication.Application):
saveasitem = FrameWork.MenuItem(m, "Save as"+ELIPSES, None, 'save_as') saveasitem = FrameWork.MenuItem(m, "Save as"+ELIPSES, None, 'save_as')
FrameWork.Separator(m) FrameWork.Separator(m)
saveasappletitem = FrameWork.MenuItem(m, "Save as Applet"+ELIPSES, None, 'save_as_applet') saveasappletitem = FrameWork.MenuItem(m, "Save as Applet"+ELIPSES, None, 'save_as_applet')
if not runningOnOSX():
# On OSX there's a special "magic" quit menu, so we shouldn't add
# it to the File menu.
FrameWork.Separator(m) FrameWork.Separator(m)
quititem = FrameWork.MenuItem(m, "Quit", "Q", 'quit') quititem = FrameWork.MenuItem(m, "Quit", "Q", 'quit')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment