          """ Set global custom styles """
          gui_style = ttk.Style()
          gui_style.configure('TLabelframe.Label', foreground="#0046D5", relief=tk.SOLID)
  
      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)
  
      def build_gui(self, rebuild=False):
          """ Build the GUI """
          logger.debug("Building GUI")
          if not rebuild:
              self.tk.call('wm', 'iconphoto', self._w, get_images().icons["favicon"])
 
</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  </s> remove         exit()
 </s> add         sys.exit(0) </s> remove         """ list: The mask names that are available for every face in the alignmnets file """
 </s> add         """ list: The mask names that are available for every face in the alignments file """ </s> remove         self.tree.delete(* self.tree.get_children())
        self.tree.configure(height=1)
 </s> add         try:
            self.tree.delete(* self.tree.get_children())
            self.tree.configure(height=1)
        except tk.TclError:
            # Catch non-existent tree view when rebuilding the GUI
            pass </s> remove         container.add(self._image_canvas, height=400 * self._scaling)
 </s> add         container.add(self._image_canvas, height=400 * get_config().scaling_factor)
          """ Set global custom styles """
          gui_style = ttk.Style()
          gui_style.configure('TLabelframe.Label', foreground="#0046D5", relief=tk.SOLID)
  



















      def build_gui(self, rebuild=False):
          """ Build the GUI """
          logger.debug("Building GUI")
          if not rebuild:
              self.tk.call('wm', 'iconphoto', self._w, get_images().icons["favicon"])
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace 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