code: def add_channel_cb(self, viewer, channel):
          
          chname = channel.name
  
          # add old highlight set to channel external data
          channel.extdata.setdefault('contents_old_highlight', set([]))
  
          # Add the channel to the treeview
          file_dict = {}
          self.name_dict.setdefault(chname, file_dict)
  
          if not self.gui_up:
              return False
  
          tree_dict = {chname: {}}
          if self.gui_up:
              self.treeview.add_tree(tree_dict)
  
          self._rebuild_channels()
docs: Called when a channel is added from the main interface.
          Parameter is a channel (a Channel object).