class_docstr: Extend the default wx toolbar with your own event handlers.
class_docstr_tok: ["Extend","the","default","wx","toolbar","with","your","own","event","handlers","."]
code: def __init__(self, canvas):
      super().__init__(canvas)
      # We use a stock wx bitmap, but you could also use your own image file.
      bmp = wx.ArtProvider.GetBitmap(wx.ART_CROSS_MARK, wx.ART_TOOLBAR)
      tool = self.AddTool(
          wx.ID_ANY, "Click me", bmp, "Activate custom control"
      )
      self.Bind(wx.EVT_TOOL, self._on_custom, id=tool.GetId())
  
file_path: matplotlib/galleries/examples/user_interfaces/embedding_in_wx4_sgskip.py
imports: import wx
  import numpy
  from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg
  from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg
  from matplotlib.figure import Figure
label_desc: Use image node_id 1 to create a new MyNavigationToolbar object from inherited base classes: NavigationToolbar with example: obj = MyNavigationToolbar(canvas)