# vtkWidget enabling and disabling

**URL:** https://discourse.vtk.org/t/vtkwidget-enabling-and-disabling/10901
**Category:** Support
**Created:** [March 6, 2023, 12:28pm UTC](https://discourse.vtk.org/t/vtkwidget-enabling-and-disabling/10901 "2023-03-06T12:28:16Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sboogert](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/59ef9b/32.png) [@sboogert](https://discourse.vtk.org/u/sboogert)
#### Post date: [March 6, 2023, 12:28pm UTC](https://discourse.vtk.org/t/vtkwidget-enabling-and-disabling/10901/1 "2023-03-06T12:28:16Z")

</div>

I have a large visualisation application using QT (Geant4) and I would like to allow users to enable and disable various widgets based on QT user interaction.

So I have absolutely no problem getting

```auto
  vtkNew<vtkImplicitPlaneRepresentation> clipperPlaneRepresentation;
  vtkNew<vtkImplicitPlaneWidget2> clipperPlaneWidget;

```

working. But I would like to disable the representation so that there is no widget in the render window. I have tried various combinations of

```auto
clipperPlaneWidget->SetEnabled(0 or 1);

```

and

```auto
clipperPlaneWidget->ProcessEventsOn();
clipperPlaneRepresentation->VisibilityOn();

```

and I cannot change the presence or absence of the widget

---

<div class="post-metadata">

### Author: ![sboogert](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/59ef9b/32.png) [@sboogert](https://discourse.vtk.org/u/sboogert)
#### Post date: [March 6, 2023, 7:20pm UTC](https://discourse.vtk.org/t/vtkwidget-enabling-and-disabling/10901/2 "2023-03-06T19:20:26Z")

</div>

Ok I’m an idiot: my private member variables were shadowed by local variables, works amazingly well.
