summaryrefslogtreecommitdiffstats
path: root/Tools/idle/EditorWindow.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-01-12 22:09:57 (GMT)
committerGuido van Rossum <guido@python.org>1999-01-12 22:09:57 (GMT)
commit5051f4f80dc001219218c49a5db4a37d821783a7 (patch)
tree6783ee419cd5cea509e9d50e38d2bf656be7989b /Tools/idle/EditorWindow.py
parent5cc3129260e33c6a736c78a07f4df1b3cc06e206 (diff)
downloadcpython-5051f4f80dc001219218c49a5db4a37d821783a7.zip
cpython-5051f4f80dc001219218c49a5db4a37d821783a7.tar.gz
cpython-5051f4f80dc001219218c49a5db4a37d821783a7.tar.bz2
Hack to close a window that is colorizing.
Diffstat (limited to 'Tools/idle/EditorWindow.py')
-rw-r--r--Tools/idle/EditorWindow.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/Tools/idle/EditorWindow.py b/Tools/idle/EditorWindow.py
index 8c0ba00..f3dacde 100644
--- a/Tools/idle/EditorWindow.py
+++ b/Tools/idle/EditorWindow.py
@@ -408,7 +408,8 @@ class EditorWindow:
text = self.text
top = self.getlineno("@0,0")
bot = self.getlineno("@0,65535")
- if top == bot:
+ if top == bot and text.winfo_height() == 1:
+ # Geometry manager hasn't run yet
height = int(text['height'])
bot = top + height - 1
return top, bot
@@ -429,15 +430,15 @@ class EditorWindow:
self.top.tkraise()
reply = self.maybesave()
if reply != "cancel":
- if self.color and self.color.colorizing:
- self.color.close()
- self.top.bell()
- return "cancel"
if self.close_hook:
self.close_hook()
+ colorizing = 0
if self.color:
- self.color.close() # Cancel colorization
- self.top.destroy()
+ colorizing = self.color.colorizing
+ doh = colorizing and self.top
+ self.color.close(doh) # Cancel colorization
+ if not colorizing:
+ self.top.destroy()
return reply
def load_extensions(self):