code: def zoom_fit(self):
          
          viewer = self.getfocus_viewer()
          if hasattr(viewer, 'zoom_fit'):
              viewer.zoom_fit()
          return True
docs: Zoom the view to fit the image entirely in the window.