code: def set_window_size(self, width, height):
          
          self._imgwin_wd = int(width)
          self._imgwin_ht = int(height)
          self._ctr_x = width // 2
          self._ctr_y = height // 2
          self.logger.debug("widget resized to %dx%d" % (width, height))
  
          self.make_callback('configure', width, height)
          self.redraw(whence=0)
docs: Report the size of the window to display the image.
  
          **Callbacks**
  
          Will call any callbacks registered for the ``'configure'`` event.
          Callbacks should have a method signature of::
  
              (viewer, width, height, ...)
  
          .. note::
  
              This is called by the subclass with ``width`` and ``height``
              as soon as the actual dimensions of the allocated window are known.
  
          Parameters
          ----------
          width : int
              The width of the window in pixels.
  
          height : int
              The height of the window in pixels.