The Code Context menu item only works on Editor windows so disable it for others.
======================================
+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.
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):
--- /dev/null
+Gray out Code Context menu entry when it's not applicable.