Get state of widget

I create a vtkContourWidget instance, and I want to know if the mouse is hovering near the endpoint of contour. The code like this:

pos = interactor.GetEventPosition()
state = contourRep.ComputeInteractionState(pos[0], pos[1])

Even though I move mouse on the endpoint, the state always return 0. Is my function is wrong or send the wrong parameter to ComputeInteractionState().
To determine if it is due to the incorrect position passed in by the mouse,I have traversed all endpoints on the cntour, and only the first endpoint returned a state value of 1.

num = contourRep.GetNumberOfNodes()
for i in range(num):
    pos = [0, 0]
    contourRep.GetNthNodeDisplayPosition(i, pos)
    print(i, contourRep.ComputeInteractionState(int(pos[0]), int(pos[1])))

Any help would be appreciated.

I still didn’t find why the value of ComputeInteractionState(pos) returns is not I want. But I find a new function GetActiveNodeDisplayPosition(pos) that can sovle my problem. When mouse on the endpoint, this function will return 1.