From 01ec11facac337c4f9980c7497c2eaff69965edb Mon Sep 17 00:00:00 2001 From: rufuswilson Date: Thu, 11 Jan 2024 11:29:59 +0100 Subject: [PATCH] Fixes DeleteButton function cf https://github.com/wxWidgets/Phoenix/issues/2511 --- wx/lib/agw/ribbon/buttonbar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wx/lib/agw/ribbon/buttonbar.py b/wx/lib/agw/ribbon/buttonbar.py index e4a4a19e..577da693 100644 --- a/wx/lib/agw/ribbon/buttonbar.py +++ b/wx/lib/agw/ribbon/buttonbar.py @@ -608,10 +608,10 @@ class RibbonButtonBar(RibbonControl): :see: :meth:`~RibbonButtonBar.ClearButtons` """ - for button in self._buttons: + for i, button in enumerate(self._buttons): if button.id == button_id: self._layouts_valid = False - self._buttons.pop(button) + self._buttons.pop(i) self.Realize() self.Refresh() return True