]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-35555: IDLE: Gray out Code Context menu item on non-editors (#11282)
authorCheryl Sabella <cheryl.sabella@gmail.com>
Sun, 23 Dec 2018 21:26:53 +0000 (16:26 -0500)
committerTerry Jan Reedy <tjreedy@udel.edu>
Sun, 23 Dec 2018 21:26:53 +0000 (16:26 -0500)
The Code Context menu item only works on Editor windows so disable it for others.

Lib/idlelib/NEWS.txt
Lib/idlelib/outwin.py
Misc/NEWS.d/next/macOS/2018-12-21-18-44-30.bpo-35555.M58_K3.rst [new file with mode: 0644]

index f46a2d7d80281d52ef3bba0983ea4eb4d089c310..68862891f6af79ad9b84226a22b6498ac737f6d0 100644 (file)
@@ -3,6 +3,8 @@ Released on 2019-10-20?
 ======================================
 
 
+bpo-35555: Gray out Code Context menu entry when it's not applicable.
+
 bpo-22703: Improve the Code Context and Zoom Height menu labels.
 The Code Context menu label now toggles between Show/Hide Code Context.
 The Zoom Height menu now toggles between Zoom/Restore Height.
index e962142498dfd87308867298f6b25aaf069b8dae..f6361eb9aef1738bed9f6a4d6cf42d102c9c1543 100644 (file)
@@ -78,6 +78,8 @@ class OutputWindow(EditorWindow):
         EditorWindow.__init__(self, *args)
         self.text.bind("<<goto-file-line>>", self.goto_file_line)
         self.text.unbind("<<toggle-code-context>>")
+        self.menudict['options'].entryconfig('*Code Context',
+                                             state='disabled')
 
     # Customize EditorWindow
     def ispythonsource(self, filename):
diff --git a/Misc/NEWS.d/next/macOS/2018-12-21-18-44-30.bpo-35555.M58_K3.rst b/Misc/NEWS.d/next/macOS/2018-12-21-18-44-30.bpo-35555.M58_K3.rst
new file mode 100644 (file)
index 0000000..0939195
--- /dev/null
@@ -0,0 +1 @@
+Gray out Code Context menu entry when it's not applicable.