code: def hl_table2canvas(self, w, res_dict):
          
          objlist = []
          width = self.markwidth + self._dwidth
  
          # Remove existing highlight
          if self.markhltag:
              try:
                  self.canvas.delete_object_by_tag(self.markhltag, redraw=False)
              except Exception:
                  pass
  
          # Display highlighted entries only in second table
          self.treeviewsel.set_tree(res_dict)
  
          for kstr, sub_dict in res_dict.items():
              s = kstr.split(',')
              marktype = s[0]
              marksize = float(s[1])
              markcolor = s[2]
  
              for bnch in sub_dict.values():
                  obj = self._get_markobj(bnch.X - self.pixelstart,
                                          bnch.Y - self.pixelstart,
                                          marktype, marksize, markcolor, width)
                  objlist.append(obj)
  
          nsel = len(objlist)
          self.w.nselected.set_text(str(nsel))
  
          # Draw on canvas
          if nsel > 0:
              self.markhltag = self.canvas.add(self.dc.CompoundObject(*objlist))
  
          self.fitsimage.redraw()
docs: Highlight marking on canvas when user click on table.