code: def __init__(self, canvas):
      GObject.GObject.__init__(self)
  
      self.set_style(Gtk.ToolbarStyle.ICONS)
  
      self._gtk_ids = {}
      for text, tooltip_text, image_file, callback in self.toolitems:
          if text is None:
              self.insert(Gtk.SeparatorToolItem(), -1)
              continue
          image = Gtk.Image.new_from_gicon(
              Gio.Icon.new_for_string(
                  str(
                      cbook._get_data_path(
                          "images", f"{image_file}-symbolic.svg"
                      )
                  )
              ),
              Gtk.IconSize.LARGE_TOOLBAR,
          )
          self._gtk_ids[text] = button = (
              Gtk.ToggleToolButton()
              if callback in ["zoom", "pan"]
              else Gtk.ToolButton()
          )
          button.set_label(text)
          button.set_icon_widget(image)
          # Save the handler id, so that we can block it as needed.
          button._signal_handler = button.connect(
              "clicked", getattr(self, callback)
          )
          button.set_tooltip_text(tooltip_text)
          self.insert(button, -1)
  
      # This filler item ensures the toolbar is always at least two text
      # lines high. Otherwise the canvas gets redrawn as the mouse hovers
      # over images because those use two-line messages which resize the
      # toolbar.
      toolitem = Gtk.ToolItem()
      self.insert(toolitem, -1)
      label = Gtk.Label()
      label.set_markup(
          "<small>\N{NO-BREAK SPACE}\n\N{NO-BREAK SPACE}</small>"
      )
      toolitem.set_expand(True)  # Push real message to the right.
      toolitem.add(label)
  
      toolitem = Gtk.ToolItem()
      self.insert(toolitem, -1)
      self.message = Gtk.Label()
      self.message.set_justify(Gtk.Justification.RIGHT)
      toolitem.add(self.message)
  
      self.show_all()
  
      _NavigationToolbar2GTK.__init__(self, canvas)
  
imports: import functools
  import logging
  import os
  from pathlib import Path
  import matplotlib
  from matplotlib import _api, backend_tools, cbook
  from matplotlib.backend_bases import ToolContainerBase, CloseEvent, KeyEvent, LocationEvent, MouseEvent, ResizeEvent
  from gi.repository import Gio, GLib, GObject, Gtk, Gdk
  from .None import _backend_gtk
  from ._backend_gtk import _BackendGTK, _FigureCanvasGTK, _FigureManagerGTK, _NavigationToolbar2GTK, TimerGTK
label_desc: Use image node_id 1 to create a new NavigationToolbar2GTK3 object from inherited base classes: _NavigationToolbar2GTK, Gtk with example: obj = NavigationToolbar2GTK3(canvas)