Skip to content

Commit 8874f51

Browse files
csabellaterryjreedy
authored andcommitted
bpo-35555: IDLE: Gray out Code Context menu item on non-editors (python#11282)
The Code Context menu item only works on Editor windows so disable it for others.
1 parent 44a3ee0 commit 8874f51

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

Lib/idlelib/NEWS.txt

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ Released on 2019-10-20?
33
======================================
44

55

6+
bpo-35555: Gray out Code Context menu entry when it's not applicable.
7+
68
bpo-22703: Improve the Code Context and Zoom Height menu labels.
79
The Code Context menu label now toggles between Show/Hide Code Context.
810
The Zoom Height menu now toggles between Zoom/Restore Height.

Lib/idlelib/outwin.py

+2
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ def __init__(self, *args):
7878
EditorWindow.__init__(self, *args)
7979
self.text.bind("<<goto-file-line>>", self.goto_file_line)
8080
self.text.unbind("<<toggle-code-context>>")
81+
self.menudict['options'].entryconfig('*Code Context',
82+
state='disabled')
8183

8284
# Customize EditorWindow
8385
def ispythonsource(self, filename):
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Gray out Code Context menu entry when it's not applicable.

0 commit comments

Comments
 (0)