summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2014-04-20 02:11:14 (GMT)
committerNed Deily <nad@acm.org>2014-04-20 02:11:14 (GMT)
commit09ae544ea3a6e33418ec8ab0100fc8288eef6d13 (patch)
tree34d30ed3f986b7c88ae9ba1c37ce3ee5e3bd1e4a
parentf31b4782084abef023d9ade3990385fb905a092f (diff)
downloadcpython-09ae544ea3a6e33418ec8ab0100fc8288eef6d13.zip
cpython-09ae544ea3a6e33418ec8ab0100fc8288eef6d13.tar.gz
cpython-09ae544ea3a6e33418ec8ab0100fc8288eef6d13.tar.bz2
Issue #11571: Ensure that the turtle window becomes the topmost window
when launched on OS X. (Original patch by Ronald Oussoren)
-rw-r--r--Lib/turtle.py7
-rw-r--r--Misc/NEWS3
2 files changed, 10 insertions, 0 deletions
diff --git a/Lib/turtle.py b/Lib/turtle.py
index ab7b6ba..599f645 100644
--- a/Lib/turtle.py
+++ b/Lib/turtle.py
@@ -109,6 +109,7 @@ import types
import math
import time
import inspect
+import sys
from os.path import isfile, split, join
from copy import deepcopy
@@ -992,6 +993,12 @@ class TurtleScreen(TurtleScreenBase):
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 --git a/Misc/NEWS b/Misc/NEWS
index 1b5ac6c..5edfb04 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -168,6 +168,9 @@ Library
- 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
-----------------