summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/PyShell.py
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2006-06-11 14:33:36 (GMT)
committerRonald Oussoren <ronaldoussoren@mac.com>2006-06-11 14:33:36 (GMT)
commit19302d927e6688e02553df16177e4867e2d0e3b3 (patch)
tree38fbc0f20e5b05833d09a560ea8d081393f19768 /Lib/idlelib/PyShell.py
parent6aaccc6b55a684771abfdad74bea742c25ded506 (diff)
downloadcpython-19302d927e6688e02553df16177e4867e2d0e3b3.zip
cpython-19302d927e6688e02553df16177e4867e2d0e3b3.tar.gz
cpython-19302d927e6688e02553df16177e4867e2d0e3b3.tar.bz2
This patch improves the L&F of IDLE on OSX. The changes are conditionalized on
being in an IDLE.app bundle on darwin. This does a slight reorganisation of the menus and adds support for file-open events.
Diffstat (limited to 'Lib/idlelib/PyShell.py')
-rw-r--r--Lib/idlelib/PyShell.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py
index f81091b..0edd2d1 100644
--- a/Lib/idlelib/PyShell.py
+++ b/Lib/idlelib/PyShell.py
@@ -11,6 +11,7 @@ import time
import threading
import traceback
import types
+import macosxSupport
import linecache
from code import InteractiveInterpreter
@@ -777,6 +778,11 @@ class PyShell(OutputWindow):
("help", "_Help"),
]
+ if macosxSupport.runningAsOSXApp():
+ del menu_specs[-3]
+ menu_specs[-2] = ("windows", "_Window")
+
+
# New classes
from IdleHistory import History
@@ -1371,9 +1377,12 @@ def main():
enable_shell = enable_shell or not edit_start
# start editor and/or shell windows:
root = Tk(className="Idle")
+
fixwordbreaks(root)
root.withdraw()
flist = PyShellFileList(root)
+ macosxSupport.setupApp(root, flist)
+
if enable_edit:
if not (cmd or script):
for filename in args:
@@ -1381,8 +1390,17 @@ def main():
if not args:
flist.new()
if enable_shell:
- if not flist.open_shell():
+ shell = flist.open_shell()
+ if not shell:
return # couldn't open shell
+
+ if macosxSupport.runningAsOSXApp() and flist.dict:
+ # On OSX: when the user has double-clicked on a file that causes
+ # IDLE to be launched the shell window will open just in front of
+ # the file she wants to see. Lower the interpreter window when
+ # there are open files.
+ shell.top.lower()
+
shell = flist.pyshell
# handle remaining options:
if debug:
@@ -1403,6 +1421,7 @@ def main():
elif script:
shell.interp.prepend_syspath(script)
shell.interp.execfile(script)
+
root.mainloop()
root.destroy()