[Python-checkins] bpo-35555: IDLE: Gray out Code Context menu item on non-editors (GH-11282) (GH-11300)

Terry Jan Reedy webhook-mailer at python.org
Sun Dec 23 17:15:02 EST 2018


https://github.com/python/cpython/commit/d4f7616da3c9aa870e9e2580e1019d6a62173e12
commit: d4f7616da3c9aa870e9e2580e1019d6a62173e12
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Terry Jan Reedy <tjreedy at udel.edu>
date: 2018-12-23T17:14:59-05:00
summary:

bpo-35555: IDLE: Gray out Code Context menu item on non-editors (GH-11282) (GH-11300)

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 at gmail.com>

files:
A Misc/NEWS.d/next/macOS/2018-12-21-18-44-30.bpo-35555.M58_K3.rst
M Lib/idlelib/NEWS.txt
M Lib/idlelib/outwin.py

diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt
index 1e4edd974e94..ca4bd053fc7f 100644
--- a/Lib/idlelib/NEWS.txt
+++ b/Lib/idlelib/NEWS.txt
@@ -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.
diff --git a/Lib/idlelib/outwin.py b/Lib/idlelib/outwin.py
index e962142498df..f6361eb9aef1 100644
--- a/Lib/idlelib/outwin.py
+++ b/Lib/idlelib/outwin.py
@@ -78,6 +78,8 @@ def __init__(self, *args):
         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
index 000000000000..0939195cadd3
--- /dev/null
+++ b/Misc/NEWS.d/next/macOS/2018-12-21-18-44-30.bpo-35555.M58_K3.rst
@@ -0,0 +1 @@
+Gray out Code Context menu entry when it's not applicable.



More information about the Python-checkins mailing list