Mercurial > cpython-lru_cache-weakref
diff Lib/idlelib/PyShell.py @ 38744:1b3b6b1982aa legacy-trunk
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.
| author | Ronald Oussoren <ronaldoussoren@mac.com> |
|---|---|
| date | Sun, 11 Jun 2006 14:33:36 +0000 |
| parents | 8fd46b660e66 |
| children | b50ab288ae27 |
line wrap: on
line diff
--- a/Lib/idlelib/PyShell.py Sun Jun 11 08:35:14 2006 +0000 +++ b/Lib/idlelib/PyShell.py Sun Jun 11 14:33:36 2006 +0000 @@ -11,6 +11,7 @@ import threading import traceback import types +import macosxSupport import linecache from code import InteractiveInterpreter @@ -777,6 +778,11 @@ ("help", "_Help"), ] + if macosxSupport.runningAsOSXApp(): + del menu_specs[-3] + menu_specs[-2] = ("windows", "_Window") + + # New classes from IdleHistory import History @@ -1371,9 +1377,12 @@ 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 @@ 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 @@ elif script: shell.interp.prepend_syspath(script) shell.interp.execfile(script) + root.mainloop() root.destroy()
