code: def __init__(self, figure=None):
      super().__init__(figure=figure)
  
      self._idle_draw_id = 0
      self._rubberband_rect = None
  
      self.connect("scroll_event", self.scroll_event)
      self.connect("button_press_event", self.button_press_event)
      self.connect("button_release_event", self.button_release_event)
      self.connect("configure_event", self.configure_event)
      self.connect("screen-changed", self._update_device_pixel_ratio)
      self.connect(
          "notify::scale-factor", self._update_device_pixel_ratio
      )
      self.connect("draw", self.on_draw_event)
      self.connect("draw", self._post_draw)
      self.connect("key_press_event", self.key_press_event)
      self.connect("key_release_event", self.key_release_event)
      self.connect("motion_notify_event", self.motion_notify_event)
      self.connect("enter_notify_event", self.enter_notify_event)
      self.connect("leave_notify_event", self.leave_notify_event)
      self.connect("size_allocate", self.size_allocate)
  
      self.set_events(self.__class__.event_mask)
  
      self.set_can_focus(True)
  
      css = Gtk.CssProvider()
      css.load_from_data(
          b".matplotlib-canvas { background-color: white; }"
      )
      style_ctx = self.get_style_context()
      style_ctx.add_provider(
          css, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
      )
      style_ctx.add_class("matplotlib-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 FigureCanvasGTK3 object from inherited base classes: _FigureCanvasGTK, Gtk with example: obj = FigureCanvasGTK3(figure)