changeset: 90417:1f3946b22e64 branch: 3.4 parent: 90415:3d1578c705c9 user: Ned Deily date: Sat Apr 19 19:11:14 2014 -0700 files: Lib/turtle.py Misc/NEWS description: Issue #11571: Ensure that the turtle window becomes the topmost window when launched on OS X. (Original patch by Ronald Oussoren) diff -r 3d1578c705c9 -r 1f3946b22e64 Lib/turtle.py --- a/Lib/turtle.py Sat Apr 19 13:25:29 2014 -0700 +++ b/Lib/turtle.py Sat Apr 19 19:11:14 2014 -0700 @@ -109,6 +109,7 @@ import math import time import inspect +import sys from os.path import isfile, split, join from copy import deepcopy @@ -992,6 +993,12 @@ self._colormode = _CFG["colormode"] self._keys = [] self.clear() + if sys.platform == 'darwin': + # Force Turtle window to the front on OS X. This is needed because + # the Turtle window will show behind the Terminal window when you + # start the demo from the command line. + cv._rootwindow.call('wm', 'attributes', '.', '-topmost', '1') + cv._rootwindow.call('wm', 'attributes', '.', '-topmost', '0') def clear(self): """Delete all drawings and all turtles from the TurtleScreen. diff -r 3d1578c705c9 -r 1f3946b22e64 Misc/NEWS --- a/Misc/NEWS Sat Apr 19 13:25:29 2014 -0700 +++ b/Misc/NEWS Sat Apr 19 19:11:14 2014 -0700 @@ -168,6 +168,9 @@ - Issue #21311: Avoid exception in _osx_support with non-standard compiler configurations. Patch by John Szakmeister. +- Issue #11571: Ensure that the turtle window becomes the topmost window + when launched on OS X. + Extension Modules -----------------