                       self.__class__.__name__, parent, config_tools, scaling)
          super().__init__(parent)
          self.pack(side=tk.RIGHT, anchor=tk.N, fill=tk.BOTH, expand=True)
          self.config_tools = config_tools
          self._scaling = scaling
  
          self._tabs = dict()
          self._build_tabs()
          self._build_sub_tabs()
          self._add_patch_callback(patch_callback)
 
</s> remove     def __init__(self, parent, config_tools, patch_callback, scaling):
        logger.debug("Initializing %s: (parent: %s, config: %s, scaling: %s)",
                     self.__class__.__name__, parent, config_tools, scaling)
 </s> add     def __init__(self, parent, config_tools, patch_callback):
        logger.debug("Initializing %s: (parent: %s, config: %s)",
                     self.__class__.__name__, parent, config_tools) </s> remove         self._scaling = self._get_scaling()
 </s> add  </s> remove         self.set_geometry()
 </s> add         self._config.set_geometry(1200, 640, self._config.user_config_dict["fullscreen"]) </s> remove         container.add(self._image_canvas, height=400 * self._scaling)
 </s> add         container.add(self._image_canvas, height=400 * get_config().scaling_factor) </s> remove     def _get_scaling(self):
        """ Get dpi and update scaling for the display.

        Returns
        -------
        float: The scaling factor for display
        """
        dpi = self.winfo_fpixels("1i")
        scaling = dpi / 72.0
        logger.debug("dpi: %s, scaling: %s'", dpi, scaling)
        return scaling

    def _set_geometry(self):
        """ Set the GUI window geometry. """
        self.tk.call("tk", "scaling", self._scaling)
        width = int(940 * self._scaling)
        height = int(600 * self._scaling)
        logger.debug("Geometry: %sx%s", width, height)
        self.geometry("{}x{}+80+80".format(str(width), str(height)))

 </s> add 
                       self.__class__.__name__, parent, config_tools, scaling)
          super().__init__(parent)
          self.pack(side=tk.RIGHT, anchor=tk.N, fill=tk.BOTH, expand=True)
          self.config_tools = config_tools

  
          self._tabs = dict()
          self._build_tabs()
          self._build_sub_tabs()
          self._add_patch_callback(patch_callback)
keep keep keep keep replace keep keep keep keep keep
 lib.gui
Centralize get_scaling and set_geometry to utils.config
Suppress Error when rebuilding GUI for TreeView 
tools/preview.py