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.
This commit is contained in:
Cheryl Sabella 2018-12-28 13:15:30 -05:00 committed by Terry Jan Reedy
parent 9e00d9e88f
commit 804a5d94b6
2 changed files with 7 additions and 3 deletions

View file

@ -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':