From 5d1b6e0d286d7ff62ea96f98113b0d418a2607c4 Mon Sep 17 00:00:00 2001 From: komoto Date: Thu, 29 Jul 2021 15:10:02 +0900 Subject: [PATCH] Fix Shell update event handler Rename the handler so that it does not override the base class EditWindow.OnUpdateUI. --- wx/py/shell.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wx/py/shell.py b/wx/py/shell.py index 6423e9a3..5f7f446b 100755 --- a/wx/py/shell.py +++ b/wx/py/shell.py @@ -305,7 +305,7 @@ class Shell(editwindow.EditWindow): # Assign handler for the context menu self.Bind(wx.EVT_CONTEXT_MENU, self.OnContextMenu) - self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI) + self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateContextMenu) # add the option to not use the stock IDs; otherwise the context menu # may not work on Mac without adding the proper IDs to the menu bar @@ -1511,7 +1511,7 @@ class Shell(editwindow.EditWindow): menu = self.GetContextMenu() self.PopupMenu(menu) - def OnUpdateUI(self, evt): + def OnUpdateContextMenu(self, evt): id = evt.Id if id in (self.ID_CUT, self.ID_CLEAR): evt.Enable(self.CanCut())