# Disable caption widget anchor point picking and dragging

**URL:** https://discourse.vtk.org/t/disable-caption-widget-anchor-point-picking-and-dragging/7883
**Category:** Support
**Created:** [February 20, 2022, 12:47pm UTC](https://discourse.vtk.org/t/disable-caption-widget-anchor-point-picking-and-dragging/7883 "2022-02-20T12:47:00Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Kent](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/k/b782af/32.png) [@Kent](https://discourse.vtk.org/u/Kent)
#### Post date: [February 20, 2022, 12:47pm UTC](https://discourse.vtk.org/t/disable-caption-widget-anchor-point-picking-and-dragging/7883/1 "2022-02-20T12:47:00Z")

</div>

Hi,

I am trying to disable anchor point picking and dragging for a caption widget. I found this article on stack overflow:

> <https://stackoverflow.com/questions/29495830/vtk-disable-anchor-picking-dragging-in-vtkcaptionwidget>

The responses seem to indicate that the proposed solutions do not necessarily work. Is there a correct way to accomplish this?

Thanks,  
Kent

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [February 21, 2022, 6:31pm UTC](https://discourse.vtk.org/t/disable-caption-widget-anchor-point-picking-and-dragging/7883/2 "2022-02-21T18:31:11Z")

</div>

Hello,

Did you try those?

regards,

Paulo

---

<div class="post-metadata">

### Author: ![Kent](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/k/b782af/32.png) [@Kent](https://discourse.vtk.org/u/Kent)
#### Post date: [February 24, 2022, 9:40am UTC](https://discourse.vtk.org/t/disable-caption-widget-anchor-point-picking-and-dragging/7883/3 "2022-02-24T09:40:27Z")

</div>

Hi,

I did try those suggestions, but they do not work.

I also tried the following without success:

vtkCaptionWidget-\>GetRepresentation-\>DragableOff();

If there are many (\>10) captions in the scene eventually a green “+” cursor will appear in the scene and if you press the left mouse button and drag, one of the caption glyphs will move away from its anchor point. For some reasons, having transparency on seems to make it more likely to happen.  
Regards,  
Kent

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [February 25, 2022, 12:58pm UTC](https://discourse.vtk.org/t/disable-caption-widget-anchor-point-picking-and-dragging/7883/4 "2022-02-25T12:58:39Z")

</div>

Hello,

Did you try subclassing `vtkCaptionWidget`? Most of `vtk*Widget` classes are utility classes that have several VTK objects in them. So, you likely need to add some methods do disable the individual scene objects (e.g. the “+” handle) one-by-one. You can identify them by looking into the `vtkCaptionWidget.h/.cpp` files.

```cpp
void MyVtkCaptionWidget::disableHandleInteraction()
{
    this->HandleWidget->EnableAxisConstraintOff();
    this->HandleWidget->EnableTranslationOff();
    this->HandleWidget->AllowHandleResizeOff();
    this->HandleWidget->SetEnabled( 0 );
}

```

I hope this helps,

Paulo

---

<div class="post-metadata">

### Author: ![Kent](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/k/b782af/32.png) [@Kent](https://discourse.vtk.org/u/Kent)
#### Post date: [February 25, 2022, 4:11pm UTC](https://discourse.vtk.org/t/disable-caption-widget-anchor-point-picking-and-dragging/7883/5 "2022-02-25T16:11:23Z")

</div>

Hi,

None of these methods were effective. EnableTranslationOff() is not defined in the version of VTK used in my company.

I also tried KeyPressActivationOff(), but it didn’t work either. After creating several captions, I hover over the arrows and sometimes a “hand” cursor appears. If I hold the mouse down, one of the caption vectors will start to move as I drag the mouse. Not even the one that the mouse was close to at the time.

Any other suggestions?

Thanks,  
Kent
