code: def _right_click(self, event):
          
          iid = self.current_iid
          if iid is None:
              if self._menu is not None:
                  self._menu.post(event.x, event.y)
              return
          args = (iid, (event.x_root, event.y_root))
          self.call_callbacks(iid, "right_callback", args)
          tags = list(self.marker_tags(iid))
          if len(tags) == 0:
              return
          menu = self._tags[tags[-1]].get("menu", None)
          if menu is None or not isinstance(menu, tk.Menu):
              return
          menu.post(event.x_root, event.y_root)
docs: Function bound to right click event for marker canvas