From 833dcf56f98c5fe2bfd885e6e13c57bc4835a9bc Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 25 Sep 2026 18:21:23 +0200 Subject: [PATCH] Add const wxWindow::GetAcceleratorTable() overload This will allow const member functions to call GetAcceleratorTable() without const_casts. --- include/wx/window.h | 3 ++- interface/wx/window.h | 13 ++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/wx/window.h b/include/wx/window.h index 4aadce6339..d05266b347 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -962,7 +962,8 @@ public: { m_acceleratorTable = accel; } wxAcceleratorTable *GetAcceleratorTable() { return &m_acceleratorTable; } - + const wxAcceleratorTable* GetAcceleratorTable() const + { return &m_acceleratorTable; } #endif // wxUSE_ACCEL #if wxUSE_HOTKEY diff --git a/interface/wx/window.h b/interface/wx/window.h index 135546d2d3..5ec85c5a17 100644 --- a/interface/wx/window.h +++ b/interface/wx/window.h @@ -3673,10 +3673,21 @@ public: void SetWindowVariant(wxWindowVariant variant); /** - Gets the accelerator table for this window. See wxAcceleratorTable. + Gets the accelerator table for this window, if any. + + @see SetAcceleratorTable(), wxAcceleratorTable */ wxAcceleratorTable* GetAcceleratorTable(); + /** + Gets the accelerator table for this window, if any. + + @see SetAcceleratorTable(), wxAcceleratorTable + + @since 3.3.4 + */ + const wxAcceleratorTable* GetAcceleratorTable() const; + /** Returns the accessible object for this window, if any. See also wxAccessible.