# Is it a bug about vtkDistanceWidget？

**URL:** https://discourse.vtk.org/t/is-it-a-bug-about-vtkdistancewidget/10958
**Category:** Support
**Tags:** code
**Created:** [March 14, 2023, 2:23am UTC](https://discourse.vtk.org/t/is-it-a-bug-about-vtkdistancewidget/10958 "2023-03-14T02:23:19Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![marlon.ma](https://discourse.vtk.org/user_avatar/discourse.vtk.org/marlon.ma/32/6091_2.png) [@marlon.ma](https://discourse.vtk.org/u/marlon.ma)
#### Post date: [March 14, 2023, 2:23am UTC](https://discourse.vtk.org/t/is-it-a-bug-about-vtkdistancewidget/10958/1 "2023-03-14T02:23:19Z")

</div>

I encountered a problem. I used the vtkDistanceWidget. I found that when two instances appear in the window, if there is no problem with clicking the second instance and blank, the events of both instances can be triggered. But when I click the first instance, it only triggers the events of the first instance. I don’t know why the events of the second instance are not triggered.

```auto
void vtkDistanceWidget1::AddPointAction(vtkAbstractWidget* w)
  if (state == vtkDistanceRepresentation::Outside)
        {
            cout << "Outside" << endl;
            self->CurrentHandle = -1;
            return;
        }

        self->GrabFocus(self->EventCallbackCommand);
        if (state == vtkDistanceRepresentation::NearP1)
        {
            cout << "NearP1" << endl;
            self->CurrentHandle = 0;
        }
        else if (state == vtkDistanceRepresentation::NearP2)
        {
            cout << "NearP2" << endl;
            self->CurrentHandle = 1;
        }

```

I use these codes to locate this problem

---

<div class="post-metadata">

### Author: ![marlon.ma](https://discourse.vtk.org/user_avatar/discourse.vtk.org/marlon.ma/32/6091_2.png) [@marlon.ma](https://discourse.vtk.org/u/marlon.ma)
#### Post date: [March 14, 2023, 6:08am UTC](https://discourse.vtk.org/t/is-it-a-bug-about-vtkdistancewidget/10958/2 "2023-03-14T06:08:51Z")

</div>

I solve it ,it is not a bug ,because into the interactor abort the event
