code: def __init__(self, canvas):
      Gtk.Box.__init__(self)
  
      self.add_css_class("toolbar")
  
      self._gtk_ids = {}
      for text, tooltip_text, image_file, callback in self.toolitems:
          if text is None:
              self.append(Gtk.Separator())
              continue
          image = Gtk.Image.new_from_gicon(
              Gio.Icon.new_for_string(
                  str(
                      cbook._get_data_path(
                          "images", f"{image_file}-symbolic.svg"
                      )
                  )
              )
          )
          self._gtk_ids[text] = button = (
              Gtk.ToggleButton()
              if callback in ["zoom", "pan"]
              else Gtk.Button()
          )
          button.set_child(image)
          button.add_css_class("flat")
          button.add_css_class("image-button")
          # 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.append(button)
  
      # 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.
      label = Gtk.Label()
      label.set_markup(
          "<small>\N{NO-BREAK SPACE}\n\N{NO-BREAK SPACE}</small>"
      )
      label.set_hexpand(True)  # Push real message to the right.
      self.append(label)
  
      self.message = Gtk.Label()
      self.message.set_justify(Gtk.Justification.RIGHT)
      self.append(self.message)
  
      _NavigationToolbar2GTK.__init__(self, canvas)
  
imports: import functools
  import io
  import os
  import matplotlib
  from matplotlib import _api, backend_tools, cbook
  from matplotlib.backend_bases import ToolContainerBase, KeyEvent, LocationEvent, MouseEvent, ResizeEvent, CloseEvent
  from gi.repository import Gio, GLib, Gtk, Gdk, GdkPixbuf
  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 NavigationToolbar2GTK4 object from inherited base classes: _NavigationToolbar2GTK, Gtk with example: obj = NavigationToolbar2GTK4(canvas)