Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
5051f4f8
Commit
5051f4f8
authored
Jan 12, 1999
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hack to close a window that is colorizing.
parent
5cc31292
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
8 deletions
+20
-8
Tools/idle/ColorDelegator.py
Tools/idle/ColorDelegator.py
+12
-1
Tools/idle/EditorWindow.py
Tools/idle/EditorWindow.py
+8
-7
No files found.
Tools/idle/ColorDelegator.py
View file @
5051f4f8
...
...
@@ -91,7 +91,9 @@ class ColorDelegator(Delegator):
if
__debug__
:
print
"schedule colorizing"
self
.
after_id
=
self
.
after
(
1
,
self
.
recolorize
)
def
close
(
self
):
close_when_done
=
None
# Window to be closed when done colorizing
def
close
(
self
,
close_when_done
=
None
):
if
self
.
after_id
:
after_id
=
self
.
after_id
self
.
after_id
=
None
...
...
@@ -99,6 +101,11 @@ class ColorDelegator(Delegator):
self
.
after_cancel
(
after_id
)
self
.
allow_colorizing
=
0
self
.
stop_colorizing
=
1
if
close_when_done
:
if
not
self
.
colorizing
:
close_when_done
.
destroy
()
else
:
self
.
close_when_done
=
close_when_done
def
toggle_colorize_event
(
self
,
event
):
if
self
.
after_id
:
...
...
@@ -140,6 +147,10 @@ class ColorDelegator(Delegator):
if
self
.
allow_colorizing
and
self
.
tag_nextrange
(
"TODO"
,
"1.0"
):
if
__debug__
:
print
"reschedule colorizing"
self
.
after_id
=
self
.
after
(
1
,
self
.
recolorize
)
if
self
.
close_when_done
:
top
=
self
.
close_when_done
self
.
close_when_done
=
None
top
.
destroy
()
def
recolorize_main
(
self
):
next
=
"1.0"
...
...
Tools/idle/EditorWindow.py
View file @
5051f4f8
...
...
@@ -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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment