summaryrefslogtreecommitdiffstats
path: root/Mac/Tools
diff options
context:
space:
mode:
authorJust van Rossum <just@letterror.com>2002-02-04 12:48:06 (GMT)
committerJust van Rossum <just@letterror.com>2002-02-04 12:48:06 (GMT)
commitbf0a9084c5258db33d764b4735ae9d7805b7908d (patch)
treec40d548351d93e505ce8fbd97bfcdc59a0279e1f /Mac/Tools
parent4e7203855e4afa4ff1f33af8f647d768d26bd97c (diff)
downloadcpython-bf0a9084c5258db33d764b4735ae9d7805b7908d.zip
cpython-bf0a9084c5258db33d764b4735ae9d7805b7908d.tar.gz
cpython-bf0a9084c5258db33d764b4735ae9d7805b7908d.tar.bz2
Don't append quit menu when on OSX, it is special and automatic there.
Diffstat (limited to 'Mac/Tools')
-rw-r--r--Mac/Tools/IDE/PythonIDEMain.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/Mac/Tools/IDE/PythonIDEMain.py b/Mac/Tools/IDE/PythonIDEMain.py
index f70f949..22ad4df 100644
--- a/Mac/Tools/IDE/PythonIDEMain.py
+++ b/Mac/Tools/IDE/PythonIDEMain.py
@@ -14,6 +14,14 @@ if MacOS.runtimemodel == 'macho':
else:
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):
def __init__(self):
@@ -62,8 +70,11 @@ class PythonIDE(Wapplication.Application):
saveasitem = FrameWork.MenuItem(m, "Save as"+ELIPSES, None, 'save_as')
FrameWork.Separator(m)
saveasappletitem = FrameWork.MenuItem(m, "Save as Applet"+ELIPSES, None, 'save_as_applet')
- FrameWork.Separator(m)
- quititem = FrameWork.MenuItem(m, "Quit", "Q", 'quit')
+ 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)
+ quititem = FrameWork.MenuItem(m, "Quit", "Q", 'quit')
m = Wapplication.Menu(self.menubar, "Edit")
undoitem = FrameWork.MenuItem(m, "Undo", 'Z', "undo")