          self._init_args = dict(debug=debug)
          self._config = self.initialize_globals()
          self.set_fonts()
          self.set_styles()
          self.set_geometry()
  
          self.wrapper = ProcessWrapper()
          self.objects = dict()
  
          get_images().delete_preview()
 
</s> remove         self._scaling = scaling
 </s> add  </s> remove         self._scaling = self._get_scaling()
 </s> add  </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 set_geometry(self):
        """ Set GUI geometry """
        fullscreen = self._config.user_config_dict["fullscreen"]
        scaling_factor = self._config.scaling_factor

        if fullscreen:
            initial_dimensions = (self.winfo_screenwidth(), self.winfo_screenheight())
        else:
            initial_dimensions = (round(1200 * scaling_factor), round(640 * scaling_factor))

        if fullscreen and sys.platform == "win32":
            self.state('zoomed')
        elif fullscreen:
            self.attributes('-zoomed', True)
        else:
            self.geometry("{}x{}+80+80".format(str(initial_dimensions[0]),
                                               str(initial_dimensions[1])))
        logger.debug("Geometry: %sx%s", *initial_dimensions)

 </s> add  </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._config.set_geometry(1200, 640, self._config.user_config_dict["fullscreen"])
          self._init_args = dict(debug=debug)
          self._config = self.initialize_globals()
          self.set_fonts()
          self.set_styles()
        self._config.set_geometry(1200, 640, self._config.user_config_dict["fullscreen"])
  
          self.wrapper = ProcessWrapper()
          self.objects = dict()
  
          get_images().delete_preview()
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 
scripts/gui.py