]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-35555: IDLE: Gray out Code Context menu item on non-editors (GH-11282) (GH-11300)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 23 Dec 2018 22:14:59 +0000 (14:14 -0800)
committerTerry Jan Reedy <tjreedy@udel.edu>
Sun, 23 Dec 2018 22:14:59 +0000 (17:14 -0500)
The Code Context menu item only works on Editor windows so disable it for others.
(cherry picked from commit 8874f511e7473b08d6b0ccd9261dd415a072a34d)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
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 1e4edd974e942137f4cf4eb6713591dc7e17c8ec..ca4bd053fc7f3661735d8a07d0b3f04cfa36c0f1 100644 (file)
@@ -3,6 +3,8 @@ Released on 2019-??-??
 ======================================
 
 
+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.