          logger.debug("Setting tk variable: (name: '%s', dtype: %s, tk_var: %s)",
                       self.name, self.dtype, var)
          return var
  
      @staticmethod
      def _modified_callback(command):
          """ Set the modified variable for this tab to TRUE
 
</s> remove         """ Set the tk variable callbacks """
 </s> add         """ Set the tkinter variable callbacks """ </s> remove     @property
    def command_tabs(self):
        """ Return dict of command tab titles with their IDs """
        return {self.command_notebook.tab(tab_id, "text").lower(): tab_id
                for tab_id in range(0, self.command_notebook.index("end"))}
 </s> add     @staticmethod
    def _get_scaling(root):
        """ Get the display DPI.

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

    def set_command_notebook(self, notebook):
        """ Set the command notebook to the :attr:`command_notebook` attribute
        and enable the modified callback for :attr:`project`.

        Parameters
        ----------
        notebook: :class:`lib.gui.command.CommandNotebook`
            The main command notebook for the Faceswap GUI
        """
        logger.debug("Setting commane notebook: %s", notebook)
        self._gui_objects["command_notebook"] = notebook
        self.project.set_modified_callback()

    def set_active_tab_by_name(self, name):
        """ Sets the :attr:`command_notebook` or :attr:`tools_notebook` to active based on given
        name.

        Parameters
        ----------
        name: str
            The name of the tab to set active
        """
        name = name.lower()
        if name in self._command_tabs:
            tab_id = self._command_tabs[name]
            logger.debug("Setting active tab to: (name: %s, id: %s)", name, tab_id)
            self.command_notebook.select(tab_id)
        elif name in self._tools_tabs:
            self.command_notebook.select(self._command_tabs["tools"])
            tab_id = self._tools_tabs[name]
            logger.debug("Setting active Tools tab to: (name: %s, id: %s)", name, tab_id)
            self.tools_notebook.select()
        else:
            logger.debug("Name couldn't be found. Setting to id 0: %s", name)
            self.command_notebook.select(0) </s> remove         """ Set a tk boolean var to callback when graph is ready to build """
 </s> add         """ Set a tkinter Boolean var to callback when graph is ready to build """ </s> remove     @property
    def tools_command_tabs(self):
        """ Return dict of tools command tab titles with their IDs """
        return {self.command_notebook.tools_notebook.tab(tab_id, "text").lower(): tab_id
                for tab_id in range(0, self.command_notebook.tools_notebook.index("end"))}
 </s> add     def set_modified_true(self, command):
        """ Set the modified variable to ``True`` for the given command in :attr:`modified_vars`.

        Parameters
        ----------
        command: str
            The command to set the modified state to ``True``

        """
        tkvar = self.modified_vars.get(command, None)
        if tkvar is None:
            logger.debug("No tkvar for command: '%s'", command)
            return
        tkvar.set(True)
        logger.debug("Set modified var to True for: '%s'", command)

    def refresh_config(self):
        """ Reload the user config from file. """
        self._user_config = UserConfig(None) </s> remove         config = get_config()
        tab = config.user_config_dict["tab"]
 </s> add         tab = self._config.user_config_dict["tab"]
        if track_modified and self._command is not None:
            logger.debug("Tracking variable modification: %s", self.name)
            var.trace("w",
                      lambda name, index, mode, cmd=self._command: self._modified_callback(cmd))

        if track_modified and self._command in ("train", "convert") and self.title == "Model Dir":
            var.trace("w", lambda name, index, mode, v=var: self._model_callback(v))

          logger.debug("Setting tk variable: (name: '%s', dtype: %s, tk_var: %s)",
                       self.name, self.dtype, var)
        if track_modified and self._command is not None:
            logger.debug("Tracking variable modification: %s", self.name)
            var.trace("w",
                      lambda name, index, mode, cmd=self._command: self._modified_callback(cmd))

        if track_modified and self._command in ("train", "convert") and self.title == "Model Dir":
            var.trace("w", lambda name, index, mode, v=var: self._model_callback(v))

          return var
  
      @staticmethod
      def _modified_callback(command):
          """ Set the modified variable for this tab to TRUE
keep add keep keep keep keep keep
 GUI Updates (#940)

* lib.gui: Update icons
* tools.cli: Add video filetype flag to mask input
* lib.gui.popup_configure: Refresh GUI on config save
* lib.gui._config: Add Icon size and load last session options
* lib.gui.control_helper - Add control modification tracking
* lib.gui - Add Projects and Last Session
- Main root title handled by projects
- Add Hotkeys
- Create projects module
- split fsw and fst filetypes
- Add last_session saving

* lib.project
- Documentation
- Ask confirm on closing unsaved project
-Fixups

* Track model folder changes
- Shuffle some globals
- Activate System Verbosity for GUI

* lib.gui.utils - Documentation and clean up
- lib.gui.custom_widgets - Create and document

* Add GUI config option to disable auto loading model stats 
lib/gui/control_helper.py