Commit 09ae544e authored by Ned Deily's avatar Ned Deily

Issue #11571: Ensure that the turtle window becomes the topmost window

when launched on OS X.  (Original patch by Ronald Oussoren)
parent f31b4782
...@@ -109,6 +109,7 @@ import types ...@@ -109,6 +109,7 @@ import types
import math import math
import time import time
import inspect import inspect
import sys
from os.path import isfile, split, join from os.path import isfile, split, join
from copy import deepcopy from copy import deepcopy
...@@ -992,6 +993,12 @@ class TurtleScreen(TurtleScreenBase): ...@@ -992,6 +993,12 @@ class TurtleScreen(TurtleScreenBase):
self._colormode = _CFG["colormode"] self._colormode = _CFG["colormode"]
self._keys = [] self._keys = []
self.clear() 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): def clear(self):
"""Delete all drawings and all turtles from the TurtleScreen. """Delete all drawings and all turtles from the TurtleScreen.
......
...@@ -168,6 +168,9 @@ Library ...@@ -168,6 +168,9 @@ Library
- Issue #21311: Avoid exception in _osx_support with non-standard compiler - Issue #21311: Avoid exception in _osx_support with non-standard compiler
configurations. Patch by John Szakmeister. configurations. Patch by John Szakmeister.
- Issue #11571: Ensure that the turtle window becomes the topmost window
when launched on OS X.
Extension Modules Extension Modules
----------------- -----------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment