Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wxGUI: BaseToolbar.OnTool needs to be explicitly defined #2632

Merged
merged 1 commit into from
Nov 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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