code: def get_linkrect_idx(self, pos):
          
          for i, r in enumerate(self.link_rects):
              if r.Contains(pos):
                  return i
          return -1
docs: Determine if cursor is inside one of the link hot spots.