Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(17)

Unified Diff: Lib/turtle.py

Issue 11571: Turtle window pops under the terminal on OSX
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/turtle.py
+++ b/Lib/turtle.py
@@ -110,6 +110,7 @@
import time
import os
import inspect
+import sys
from os.path import isfile, split, join
from copy import deepcopy
@@ -994,6 +995,13 @@
self._keys = []
self.clear()
+ if sys.platform == 'darwin':
+ # Force Turtle window to the front on OSX. This is needed
+ # because the Turtle window will show behind the Terminal
+ # window when you show the turtle window 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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+