class_docstr: Attributes
  ----------
  canvas : `FigureCanvas`
      The FigureCanvas instance
  num : int or str
      The Figure number
  toolbar : Gtk.Toolbar or Gtk.Box
      The toolbar
  vbox : Gtk.VBox
      The Gtk.VBox containing the canvas and toolbar
  window : Gtk.Window
      The Gtk.Window
class_docstr_tok: ["Attributes","--","--","--","--","--","canvas",":","`","FigureCanvas","`","The","FigureCanvas","instance","num",":","int","or","str","The","Figure","number","toolbar",":","Gtk.Toolbar","or","Gtk.Box","The","toolbar","vbox",":","Gtk.VBox","The","Gtk.VBox","containing","the","canvas","and","toolbar","window",":","Gtk.Window","The","Gtk.Window"]
code: def resize(self, width, height):
      width = int(width / self.canvas.device_pixel_ratio)
      height = int(height / self.canvas.device_pixel_ratio)
      if self.toolbar:
          min_size, nat_size = self.toolbar.get_preferred_size()
          height += nat_size.height
      canvas_size = self.canvas.get_allocation()
      if (
          self._gtk_ver >= 4
          or canvas_size.width == canvas_size.height == 1
      ):
          # A canvas size of (1, 1) cannot exist in most cases, because
          # window decorations would prevent such a small window. This call
          # must be before the window has been mapped and widgets have been
          # sized, so just change the window's starting size.
          self.window.set_default_size(width, height)
      else:
          self.window.resize(width, height)
  
imports: import logging
  import sys
  import matplotlib
  from matplotlib import _api, backend_tools, cbook
  from matplotlib._pylab_helpers import Gcf
  from matplotlib.backend_bases import _Backend, FigureCanvasBase, FigureManagerBase, NavigationToolbar2, TimerBase
  from matplotlib.backend_tools import Cursors
  import gi
  from gi.repository import Gdk, Gio, GLib, Gtk
label_desc: Use image node_id 8 for calling the _FigureManagerGTK obj's underlying member method code with example usage: obj.resize(width, height) without return types