Skip to content

Commit

Permalink
wxGUI: BaseToolbar.OnTool needs to be explicitly defined (#2632)
Browse files Browse the repository at this point in the history
Fixes #2626
  • Loading branch information
petrasovaa committed Nov 11, 2022
1 parent 004df20 commit b271212
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion gui/wxpython/gui_core/toolbars.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,12 @@


class ToolbarController:
"""Controller specialized for wx.ToolBar subclass."""
"""Controller specialized for wx.ToolBar subclass.
Toolbar subclasses must delegate methods to controller.
Methods inherited from toolbar class must be delegated explicitly
and other methods can be delegated by @c __getattr__.
"""

def __init__(self, classObject, widget, parent, toolSwitcher):
"""
Expand Down Expand Up @@ -372,6 +377,10 @@ def CreateTool(self, *args, **kwargs):
"""@copydoc ToolbarController::CreateTool()"""
self.controller.CreateTool(*args, **kwargs)

def OnTool(self, event):
"""@copydoc ToolbarController::OnTool()"""
self.controller.OnTool(event)

def __getattr__(self, name):
return getattr(self.controller, name)

Expand Down Expand Up @@ -416,6 +425,10 @@ def CreateTool(self, *args, **kwargs):
"""@copydoc ToolbarController::CreateTool()"""
self.controller.CreateTool(*args, **kwargs)

def OnTool(self, event):
"""@copydoc ToolbarController::OnTool()"""
self.controller.OnTool(event)

def __getattr__(self, name):
return getattr(self.controller, name)

Expand Down

0 comments on commit b271212

Please sign in to comment.