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
2ed6d982
Commit
2ed6d982
authored
Jun 25, 1999
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add close() method that breaks a cycle.
parent
e415c745
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
4 deletions
+23
-4
Tools/idle/CallTips.py
Tools/idle/CallTips.py
+3
-0
Tools/idle/FormatParagraph.py
Tools/idle/FormatParagraph.py
+3
-0
Tools/idle/IOBinding.py
Tools/idle/IOBinding.py
+17
-4
No files found.
Tools/idle/CallTips.py
View file @
2ed6d982
...
...
@@ -32,6 +32,9 @@ class CallTips:
else
:
self
.
_make_calltip_window
=
self
.
_make_tk_calltip_window
def
close
(
self
):
self
.
_make_calltip_window
=
None
# Makes a Tk based calltip window. Used by IDLE, but not Pythonwin.
# See __init__ above for how this is used.
def
_make_tk_calltip_window
(
self
):
...
...
Tools/idle/FormatParagraph.py
View file @
2ed6d982
...
...
@@ -36,6 +36,9 @@ class FormatParagraph:
def
__init__
(
self
,
editwin
):
self
.
editwin
=
editwin
def
close
(
self
):
self
.
editwin
=
None
def
format_paragraph_event
(
self
,
event
):
text
=
self
.
editwin
.
text
first
,
last
=
self
.
editwin
.
get_selection_indices
()
...
...
Tools/idle/IOBinding.py
View file @
2ed6d982
...
...
@@ -24,10 +24,23 @@ class IOBinding:
def
__init__
(
self
,
editwin
):
self
.
editwin
=
editwin
self
.
text
=
editwin
.
text
self
.
text
.
bind
(
"<<open-window-from-file>>"
,
self
.
open
)
self
.
text
.
bind
(
"<<save-window>>"
,
self
.
save
)
self
.
text
.
bind
(
"<<save-window-as-file>>"
,
self
.
save_as
)
self
.
text
.
bind
(
"<<save-copy-of-window-as-file>>"
,
self
.
save_a_copy
)
self
.
__id_open
=
self
.
text
.
bind
(
"<<open-window-from-file>>"
,
self
.
open
)
self
.
__id_save
=
self
.
text
.
bind
(
"<<save-window>>"
,
self
.
save
)
self
.
__id_saveas
=
self
.
text
.
bind
(
"<<save-window-as-file>>"
,
self
.
save_as
)
self
.
__id_savecopy
=
self
.
text
.
bind
(
"<<save-copy-of-window-as-file>>"
,
self
.
save_a_copy
)
def
close
(
self
):
# Undo command bindings
self
.
text
.
unbind
(
"<<open-window-from-file>>"
,
self
.
__id_open
)
self
.
text
.
unbind
(
"<<save-window>>"
,
self
.
__id_save
)
self
.
text
.
unbind
(
"<<save-window-as-file>>"
,
self
.
__id_saveas
)
self
.
text
.
unbind
(
"<<save-copy-of-window-as-file>>"
,
self
.
__id_savecopy
)
# Break cycles
self
.
editwin
=
None
self
.
text
=
None
self
.
filename_change_hook
=
None
def
get_saved
(
self
):
return
self
.
editwin
.
get_saved
()
...
...
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