summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/editor.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-12-28 18:29:06 (GMT)
committerGitHub <noreply@github.com>2018-12-28 18:29:06 (GMT)
commit61775c313f6116e627fe837ac5e3e11a3d14eb78 (patch)
treea9c85ee10ed50451f2f715657f9f6d1ff3ad1c71 /Lib/idlelib/editor.py
parent098bb249e9cf315b9e3b7d4bdad039a093d049c4 (diff)
downloadcpython-61775c313f6116e627fe837ac5e3e11a3d14eb78.zip
cpython-61775c313f6116e627fe837ac5e3e11a3d14eb78.tar.gz
cpython-61775c313f6116e627fe837ac5e3e11a3d14eb78.tar.bz2
IDLE: Create function to update menu item state. (GH-11343)
This will be needed for other menu items. Change outwin to call the function instead of updating the menu item directly. (cherry picked from commit 804a5d94b6b7f8cb8546112aee2bc3af362f28f5) Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
Diffstat (limited to 'Lib/idlelib/editor.py')
-rw-r--r--Lib/idlelib/editor.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/idlelib/editor.py b/Lib/idlelib/editor.py
index d92b32b..f443766 100644
--- a/Lib/idlelib/editor.py
+++ b/Lib/idlelib/editor.py
@@ -447,10 +447,15 @@ class EditorWindow(object):
window.add_windows_to_menu(menu)
def update_menu_label(self, menu, index, label):
- "Update label for menu item at index ."
+ "Update label for menu item at index."
menuitem = self.menudict[menu]
menuitem.entryconfig(index, label=label)
+ def update_menu_state(self, menu, index, state):
+ "Update state for menu item at index."
+ menuitem = self.menudict[menu]
+ menuitem.entryconfig(index, state=state)
+
def handle_yview(self, event, *args):
"Handle scrollbar."
if event == 'moveto':