From 9c93fe829bc6f85589b261a108073f914f1f9981 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Sun, 24 Feb 2002 23:17:23 +0000 Subject: [PATCH] Backport of 1.27 and 1.28: - Added minimal support for floating windows. - Changes by Donovan Preston (and a few minor ones by me) to make IDE run under MachoPython. Mainly making sure we don't call routines that don't exist and representing pathnames in a os.separator-neutral format. These shouldn't interfere too much with Just's work on the next generation IDE, I hope. --- Mac/Tools/IDE/PyEdit.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Mac/Tools/IDE/PyEdit.py b/Mac/Tools/IDE/PyEdit.py index 828b697176e4..fcbdc0902e2b 100644 --- a/Mac/Tools/IDE/PyEdit.py +++ b/Mac/Tools/IDE/PyEdit.py @@ -17,6 +17,12 @@ import string import marshal import re +if hasattr(Win, "FrontNonFloatingWindow"): + MyFrontWindow = Win.FrontNonFloatingWindow +else: + MyFrontWindow = Win.FrontWindow + + try: import Wthreading except ImportError: @@ -1128,7 +1134,8 @@ def execstring(pytext, globals, locals, filename="", debugging=0, else: PyDebugger.startfromhere() elif not haveThreading: - MacOS.EnableAppswitch(0) + if hasattr(MacOS, 'EnableAppswitch'): + MacOS.EnableAppswitch(0) try: if profiling: import profile, ProfileBrowser @@ -1145,7 +1152,8 @@ def execstring(pytext, globals, locals, filename="", debugging=0, exec code in globals, locals finally: if not haveThreading: - MacOS.EnableAppswitch(-1) + if hasattr(MacOS, 'EnableAppswitch'): + MacOS.EnableAppswitch(-1) except W.AlertError, detail: raise W.AlertError, detail except (KeyboardInterrupt, BdbQuit): @@ -1187,7 +1195,7 @@ def _filename_as_modname(fname): return string.join(string.split(modname, '.'), '_') def findeditor(topwindow, fromtop = 0): - wid = Win.FrontWindow() + wid = MyFrontWindow() if not fromtop: if topwindow.w and wid == topwindow.w.wid: wid = topwindow.w.wid.GetNextWindow() -- 2.47.3