          for action in ('<Enter>', '<FocusIn>', '<Leave>', '<FocusOut>'):
              helptext = helptext if action in ('<Enter>', '<FocusIn>') else ''
              control.bind(action, lambda event, txt=helptext: self.helptext.set(txt))
  
      def execute_task(self, command):
          ''' Execute the task in Faceswap.py '''
          self.task.execute_script(self.opts, command, self.parser, self.statustext)
  
  class ActionFrame(object):
      '''Action Frame - Displays information and action controls '''
      def __init__(self, gui, page, command):
          self.gui = gui
 
</s> remove     def bind_help(self, control, helptext):
        ''' Controls the help text displayed on mouse hover '''
        for action in ('<Enter>', '<FocusIn>', '<Leave>', '<FocusOut>'):
            helptext = helptext if action in ('<Enter>', '<FocusIn>') else ''
            control.bind(action, lambda event, txt=helptext: self.helptext.set(txt))
 </s> add     def delete_preview(self):
        """ Delete the preview file """
        if os.path.exists(self.previewloc):
            os.remove(self.previewloc) </s> remove class ActionFrame(object):
    '''Action Frame - Displays information and action controls '''
    def __init__(self, gui, page, command):
        self.gui = gui
        self.page = page
        self.command = command
        self.title = command.title()
 </s> add class Tooltip:
    """
    Create a tooltip for a given widget as the mouse goes on it. </s> remove     ''' Tabs to hold the command options '''
    def __init__(self, gui, notebook, command):
        self.gui = gui
 </s> add     """ Tabs to hold the command options """

    def __init__(self, utils, notebook, command):
        self.utils = utils </s> remove         for utl in ('load', 'save', 'clear', 'reset'):
            img = getattr(self.gui, 'ico' + utl)
            action = getattr(self.gui, utl + '_config')
            btnutl = tk.Button( utlframe,
                                height=16,
                                width=16,
                                image=img,
                                command=lambda cmd=action: cmd(self.command))
            btnutl.pack(padx=2, pady=2, side=tk.LEFT)
            self.gui.bind_help(btnutl, utl.capitalize() + ' ' + self.title + ' config')

    def add_status_section(self, frame):
        ''' Build the info text section page '''
        statusframe = tk.Frame(frame)
        statusframe.pack(side=tk.TOP, pady=(5,0))
        
        lbltitle = tk.Label(statusframe, text='Status', width=15, anchor=tk.SW)
        lbltitle.pack(side=tk.TOP)
        self.gui.statustext.set('Idle')
        lblstatus = tk.Label(   statusframe,
                                height=1,
                                width=15,
                                textvariable=self.gui.statustext,
                                wraplength=120,
                                justify=tk.LEFT,
                                anchor=tk.NW,
                                bg="gray90")
        lblstatus.pack(side=tk.BOTTOM, anchor=tk.N)
 </s> add  </s> remove # All pages stuff
    def menu(self):
        ''' Menu bar for loading and saving configs '''
        menubar = tk.Menu(self.gui)
        filemenu = tk.Menu(menubar, tearoff=0)
        filemenu.add_command(label='Load full config...', command=self.load_config)
        filemenu.add_command(label='Save full config...', command=self.save_config)
        filemenu.add_separator()
        filemenu.add_command(label='Reset all to default', command=self.reset_config)
        filemenu.add_command(label='Clear all', command=self.clear_config)
        filemenu.add_separator()
        filemenu.add_command(label='Quit', command=self.gui.quit)
        menubar.add_cascade(label="File", menu=filemenu)
        self.gui.config(menu=menubar)
 </s> add         self.lossdict = dict()

    def init_tk(self):
        """ TK System must be on prior to setting tk variables,
        so initialised from GUI """
        pathicons = os.path.join(PATHSCRIPT, 'icons')
        self.icons['folder'] = tk.PhotoImage(
            file=os.path.join(pathicons, 'open_folder.png'))
        self.icons['load'] = tk.PhotoImage(
            file=os.path.join(pathicons, 'open_file.png'))
        self.icons['save'] = tk.PhotoImage(
            file=os.path.join(pathicons, 'save.png'))
        self.icons['reset'] = tk.PhotoImage(
            file=os.path.join(pathicons, 'reset.png'))
        self.icons['clear'] = tk.PhotoImage(
            file=os.path.join(pathicons, 'clear.png'))

        self.guitext['help'] = tk.StringVar()
        self.guitext['status'] = tk.StringVar()

    def action_command(self, command):
        """ The action to perform when the action button is pressed """
        if self.runningtask:
            self.action_terminate()
        else:
            self.action_execute(command)

    def action_execute(self, command):
        """ Execute the task in Faceswap.py """
        self.clear_console()
        self.task.prepare(self.opts, command)
        self.task.execute_script()

    def action_terminate(self):
        """ Terminate the subprocess Faceswap.py task """
        self.task.terminate()
        self.runningtask = False
        self.clear_display_panel()
        self.change_action_button()

    def clear_display_panel(self):
        ''' Clear the preview window and graph '''
        self.delete_preview()
        self.lossdict = dict()

    def change_action_button(self):
        """ Change the action button to relevant control """
        for cmd in self.actionbtns.keys():
            btnact = self.actionbtns[cmd]
            if self.runningtask:
                ttl = 'Terminate'
                hlp = 'Exit the running process'
            else:
                ttl = cmd.title()
                hlp = 'Run the {} script'.format(cmd.title())
            btnact.config(text=ttl)
            Tooltip(btnact, text=hlp, wraplength=200)

    def clear_console(self):
        """ Clear the console output screen """
        self.console.delete(1.0, tk.END)
          for action in ('<Enter>', '<FocusIn>', '<Leave>', '<FocusOut>'):
              helptext = helptext if action in ('<Enter>', '<FocusIn>') else ''
              control.bind(action, lambda event, txt=helptext: self.helptext.set(txt))
  



  
  class ActionFrame(object):
      '''Action Frame - Displays information and action controls '''
      def __init__(self, gui, page, command):
          self.gui = gui
keep keep keep keep replace replace replace keep keep keep keep keep
 GUI v0.2.1b (#352)

* Code refactor

* Console Added

* Add graphing with matplotlib

* Add GUI preview support

* Improve import handling.

* Add GUI integration for tools.py (Launch tools.py with the gui command)

* Reformat to conform to PEP8.

* Add Tooltips, 

* Make panels user adjustable

* Fix convert.py Sharpen default value 
scripts/gui.py