  
          etybox = tk.Entry(frame, textvariable=etyvar)
          etybox.pack(fill=tk.X, padx=5, pady=5)
  
          self.bind_help(etybox, helptext)
          return etyvar
  
      def add_browser_buttons(self, frame, opentype, filepath):
          ''' Add correct file browser button for control '''
          if opentype == 'filechooser':
              fileopn = tk.Button(frame, image=self.icofile, command=lambda: self.askfile(filepath), width=16, height=16)
 
</s> remove     def add_browser_buttons(self, frame, opentype, filepath):
 </s> add         ctl = control(frame, **ctlkwargs)
        
        if control == ttk.Combobox:
            ctl['values'] = [choice for choice in choices]
        
        ctl.pack(padx=5, pady=5, **packkwargs)

        self.gui.bind_help(ctl, helptext)
        return(var)

    def add_browser_buttons(self, frame, sysbrowser, filepath): </s> remove         if opentype == 'filechooser':
            fileopn = tk.Button(frame, image=self.icofile, command=lambda: self.askfile(filepath), width=16, height=16)
        else:
            fileopn = tk.Button(frame, image=self.icofolder, command=lambda: self.askdirectory(filepath))
 </s> add         img = getattr(self.gui, 'ico' + sysbrowser)
        action = getattr(self, 'ask_' + sysbrowser)
        fileopn = tk.Button(frame, image=img, command=lambda cmd=action: cmd(filepath)) </s> remove         etybox = tk.Entry(frame, textvariable=etyvar)
        etybox.pack(fill=tk.X, padx=5, pady=5)
 </s> add         ctlkwargs = {'variable': var} if control == tk.Checkbutton else {'textvariable': var}
        packkwargs = {'anchor': tk.W} if control == tk.Checkbutton else {'fill': tk.X} </s> remove         if opentype is not None:
            self.add_browser_buttons(frame, opentype, etyvar)
 </s> add         var = tk.BooleanVar(frame) if control == tk.Checkbutton else tk.StringVar(frame)
        var.set(default)

        if sysbrowser is not None:
            self.add_browser_buttons(frame, sysbrowser, var) </s> remove         etyvar = tk.StringVar(frame)
        etyvar.set(default)
 </s> add 
        if control == ttk.Combobox: #TODO: Remove this hacky fix to force the width of the frame
            ctlkwargs['width'] = 40
  
          etybox = tk.Entry(frame, textvariable=etyvar)
          etybox.pack(fill=tk.X, padx=5, pady=5)
  
        if control == ttk.Combobox: #TODO: Remove this hacky fix to force the width of the frame
            ctlkwargs['width'] = 40
        if control == ttk.Combobox: #TODO: Remove this hacky fix to force the width of the frame
            ctlkwargs['width'] = 40
  
      def add_browser_buttons(self, frame, opentype, filepath):
          ''' Add correct file browser button for control '''
          if opentype == 'filechooser':
              fileopn = tk.Button(frame, image=self.icofile, command=lambda: self.askfile(filepath), width=16, height=16)
keep keep keep keep replace replace keep keep keep keep keep
 GUI v0.1.0a (#336)

* Code clean up

* Code refactor

* bugfix: Find paths to icons when launched from outside faceswap dir

* Bugfix: Disable GUI if TkInter app not available

* BugFix: Disable GUI if $DISPLAY not detected

* Minor code ammends

* Code Refactor

* DISPLAY check fix 
scripts/gui.py